QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#302654 | #2734. Professional Network | Camillus | Compile Error | / | / | C++20 | 619b | 2024-01-11 02:06:35 | 2024-01-11 02:06:36 |
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[i].first < k) {
res++;
k++;
a.pop_back();
}
if (!a.empty()) {
k++;
a.pop_front();
}
}
cout << res;
}
Details
answer.code: In function ‘int main()’: answer.code:19:32: error: ‘i’ was not declared in this scope 19 | while (!a.empty() && a[i].first < k) { | ^