| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1153914 | justin271828 | Index (COCI21_index) | C++20 | 37 ms | 320 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, q;
cin >> n >> q;
int arr[n];
for (int i = 0; i < n; i++) cin >> arr[i];
for (int qwerty = 0; qwerty < q; qwerty++) {
int l, r;
cin >> l >> r;
priority_queue<int> pq;
for (int i = l; i <= r; i++) pq.push(arr[i-1]);
int ans = 1;
while (true) {
if (pq.empty()) break;
if (pq.top() < ans) break;
ans++;
pq.pop();
}
cout << ans << "\n";
}
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
