用户输出
440
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#13482 | #1077. 1-11B. JM的招摇撞骗 | Wrong Answer | 0 | 29 ms | 356 K | C++ / 467 B | 软件82-王成昊 | 2019-07-06 23:23:48 |
#include <bits/stdc++.h>
using namespace std;
struct nfsq {
int a, b;
} q[200005];
bool cmp(nfsq x, nfsq y) { return x.b > y.b; }
int main() {
int v, n;
scanf("%d%d", &v, &n);
for (int i = 1; i <= n; ++i) scanf("%d%d", &q[i].a, &q[i].b);
sort(q + 1, q + 1 + n, cmp);
long long tot = 0;
for (int i = 1; i <= n; ++i) {
if (v >= q[i].a) {
v -= q[i].a;
tot += q[i].a * q[i].b;
} else {
tot += v * q[i].b;
break;
}
}
printf("%lld", tot);
return 0;
}
用户输出
19855
系统信息
Exited with return code 0
用户输出
-1157098477
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0