Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
231291 | 陈柏丞 | *小美的外卖订单 | C++ | Accepted | 100 | 4 MS | 272 KB | 531 | 2024-01-13 20:23:55 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; double yzj(0), zkj(0), mjj(0); for(int i = 1;i <= n;i++){ double a, b; cin >> a >> b; if(b > a){ cout << "error"; return 0; } yzj += a; zkj += b; } cout << fixed << setprecision(2); int x, y; cin >> x >> y; if(y > yzj){ cout << "error"; return 0; } if(yzj >= x){ mjj = yzj-y; }else{ cout << zkj; return 0; } if(zkj < mjj){ cout << zkj; }else{ cout << mjj; } return 0; }