Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
229964 陆沛埦 *小美的外卖订单 C++ 解答错误 40 0 MS 424 KB 531 2024-01-07 14:21:00

Tests(2/5):


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


测评信息: