QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#302616 | #2734. Professional Network | Camillus | 0 | 10ms | 5480kb | C++20 | 643b | 2024-01-11 00:46:30 | 2024-01-11 00:46:31 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> a(n);
vector<int> b(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
cin >> b[i];
}
vector<int> c(n);
iota(c.begin(), c.end(), 0);
sort(c.begin(), c.end(), [&a](int i, int j) {
return a[i] < a[j];
});
int cnt = 0;
int sum = 0;
for (int i : c) {
if (a[i] > cnt) {
sum += b[i];
}
cnt += 1;
}
cout << sum << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 2
Accepted
time: 10ms
memory: 5480kb
input:
200000 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0...
output:
0
result:
ok single line: '0'
Test #2:
score: -2
Wrong Answer
time: 8ms
memory: 3856kb
input:
55848 8787 1 40423 1 4209 1 45140 1 40852 1 4984 1 48967 1 28225 1 8553 1 29753 1 24173 1 12996 1 41846 1 19903 1 42728 1 18675 1 18103 1 45100 1 1689 1 34439 1 4780 1 3489 1 27184 1 5120 1 33927 1 54366 1 36868 1 34457 1 21443 1 2077 1 3841 1 11477 1 14409 1 37845 1 2713 1 2799 1 31291 1 53308 1 49...
output:
42651
result:
wrong answer 1st lines differ - expected: '161', found: '42651'
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 4
Accepted
time: 0ms
memory: 3596kb
input:
1 0 0
output:
0
result:
ok single line: '0'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
10 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000
output:
100000
result:
ok single line: '100000'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
10 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0
output:
0
result:
ok single line: '0'
Test #14:
score: -4
Wrong Answer
time: 0ms
memory: 3496kb
input:
10 10 219 9 728 8 425 8 380 7 512 7 617 8 434 9 789 8 74 7 100
output:
4278
result:
wrong answer 1st lines differ - expected: '2360', found: '4278'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%