用户输出
440
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#24391 | #1077. 1-11B. JM的招摇撞骗 | Wrong Answer | 0 | 15 ms | 364 K | C++ 17 / 560 B | 电类944-李泊宇 | 2020-04-25 13:00:51 |
#include <iostream>
#include <algorithm>
#define rep(i, a, b) for (int i = a; i <= b; i++)
using namespace std;
int V, n;
struct Node {
int a;
int b;
bool operator<(Node node) { return this->b > node.b; }
} list[200005];
int main() {
ios::sync_with_stdio(false);
cin >> V >> n;
rep(i, 1, n) { cin >> list[i].a >> list[i].b; }
sort(list + 1, list + n + 1);
int cnt = 0;
int result = 0;
rep(i, 1, n) {
rep(j, 1, list[i].a) {
if (cnt < V) {
cnt++;
result += list[i].b;
}
}
}
cout << result;
}
用户输出
19855
系统信息
Exited with return code 0
用户输出
-1157098477
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0