Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
229987 陆沛埦 *小美的外卖订单 C++ 通过 100 0 MS 272 KB 508 2024-01-07 14:37:51

Tests(5/5):


#include <bits/stdc++.h> using namespace std; long long n; double a,b; double sum,t,m,total; bool d=false; int main() { scanf("%lld",&n); for(int i=1; i<=n; i++) { scanf("%lf%lf",&a,&b); if(b>a) { printf("error\n"); return 0; } sum+=b; total+=a; } scanf("%lf%lf",&t,&m); if(m>t) { printf("error\n"); return 0; } if(total>=t) total-=m; if(total<=0||sum<=0) { printf("error\n"); return 0; } printf("%.2lf\n",min(total,sum)); return 0; }


测评信息: