QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
详细
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) { | ^