45105
56 94
38 17
45 46
94 65
42 77
4 31
71 51
49 31
82 9
11 62
33 30
50 19
52 61
32 8
<308494 bytes omitted>
系统信息
Killed: Segmentation fault
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#63946 | #1022. jwp的排队难题 | Runtime Error | 0 | 17 ms | 440 K | C++ 11 / 364 B | Blaze | 2021-12-07 15:47:38 |
#include <iostream>
#include <algorithm>
using namespace std;
pair<int, int> p[100];
int main() {
int n, sum = 0, cur = 0;
cin >> n;
for (int i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
sort(p, p + n, greater<pair<int, int>>());
for (int i = 0; i < n; i++) {
cur += p[i].second;
sum += p[i].first * cur;
}
cout << sum << endl;
}
45105
56 94
38 17
45 46
94 65
42 77
4 31
71 51
49 31
82 9
11 62
33 30
50 19
52 61
32 8
<308494 bytes omitted>
系统信息
Killed: Segmentation fault
6667
81 6
83 71
57 69
97 27
5 84
20 77
28 77
77 57
97 49
40 18
78 39
41 69
14 11
99 1
<45515 bytes omitted>
系统信息
Killed: Segmentation fault
55457
60 47
63 7
81 14
91 88
2 83
4 35
80 77
55 46
97 57
65 10
56 14
15 43
88 3
19 62
<379227 bytes omitted>
系统信息
Killed: Segmentation fault
54839
31 85
77 24
87 83
9 18
35 74
88 40
59 14
47 63
50 31
17 40
1 23
71 10
43 69
24 1
<374961 bytes omitted>
系统信息
Killed: Segmentation fault