# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
862261 | 2023-10-17T21:19:33 Z | TAhmed33 | Osumnjičeni (COCI21_osumnjiceni) | C++ | 1000 ms | 8088 KB |
#include <bits/stdc++.h> using namespace std; int main () { int n; cin >> n; pair <int, int> arr[n + 1]; for (int i = 1; i <= n; i++) cin >> arr[i].first >> arr[i].second; int q; cin >> q; while (q--) { int l, r; cin >> l >> r; multiset <int> cur; vector <pair <int, int>> p; for (int i = l; i <= r; i++) { p.push_back(arr[i]); } sort(p.begin(), p.end()); int ans = 0; for (auto [x, y] : p) { if (cur.empty()) { cur.insert(y); ans = max(ans, 1); continue; } auto l = cur.begin(); if (*l >= x) { cur.insert(y); } else { cur.erase(l); cur.insert(y); } ans = max(ans, (int)cur.size()); } cout << ans << '\n'; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 183 ms | 7900 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1033 ms | 712 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1033 ms | 712 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1050 ms | 8088 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 183 ms | 7900 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |