Submission #862257

#TimeUsernameProblemLanguageResultExecution timeMemory
862257TAhmed33Osumnjičeni (COCI21_osumnjiceni)C++98
0 / 110
1058 ms23380 KiB
#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; map <int, int> x; for (int i = l; i <= r; i++) { x[arr[i].first]++; x[arr[i].second + 1]--; } int cur = 0; int mx = 0; for (auto i : x) { cur += i.second; mx = max(mx, cur); } cout << mx << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...