用户输出
440
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#22552 | #1077. 1-11B. JM的招摇撞骗 | Wrong Answer | 0 | 15 ms | 360 K | C++ / 508 B | 电类904-穆琳杰 | 2020-02-13 13:21:02 |
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 2e5 + 5;
long long int V, n;
struct nfsq {
long long int a;
long long int b;
} a[N];
bool cmp(nfsq a, nfsq b) { return a.b > b.b; }
int main() {
cin >> V >> n;
for (int i = 1; i <= n; i++) cin >> a[i].a >> a[i].b;
sort(a + 1, a + n + 1, cmp);
int ans = 0;
for (int i = 1; i <= n; i++) {
if (V > a[i].a) {
V -= a[i].a;
ans += a[i].a * a[i].b;
} else {
ans += V * a[i].b;
break;
}
}
cout << ans << endl;
return 0;
}
用户输出
19855
系统信息
Exited with return code 0
用户输出
-1157098477
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0