Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
229977 陆沛埦 *小美的外卖订单 C++ 编译错误 0 0 MS 0 KB 545 2024-01-07 14:31:55

Tests(0/0):


#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||a<=0||b<=0) d=true; sum+=b[i]; total+=a[i]; } scanf("%lf%lf",&t,&m); if(m>t) { printf("error\n"); return 0; } if(d==true) { 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; }


测评信息: