QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#302655 | #2734. Professional Network | Camillus | 0 | 14ms | 5188kb | C++20 | 619b | 2024-01-11 02:07:04 | 2024-01-11 02:07:04 |
Judging History
answer
#include "bits/stdc++.h"
using ll = long long;
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
deque<pair<int, int>> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i].first >> a[i].second;
}
sort(a.begin(), a.end());
int res = 0;
int k = 0;
while (!a.empty()) {
while (!a.empty() && a[0].first < k) {
res++;
k++;
a.pop_back();
}
if (!a.empty()) {
k++;
a.pop_front();
}
}
cout << res;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 14ms
memory: 5188kb
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:
199999
result:
wrong answer 1st lines differ - expected: '0', found: '199999'
Subtask #2:
score: 0
Wrong Answer
Test #11:
score: 4
Accepted
time: 0ms
memory: 3624kb
input:
1 0 0
output:
0
result:
ok single line: '0'
Test #12:
score: -4
Wrong Answer
time: 0ms
memory: 3616kb
input:
10 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000 10 10000
output:
0
result:
wrong answer 1st lines differ - expected: '100000', found: '0'
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
0%