Submission #619059

#TimeUsernameProblemLanguageResultExecution timeMemory
6190591binUntitled (POI11_tem)C++14
0 / 100
194 ms18508 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(v) v.begin(), v.end() typedef long long ll; const int NMAX = 1e6 + 5; int n, mn, mx, ans, x; deque<pair<int, int>> dq; int main(void){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n; for(int i = 0; i < n; i++){ cin >> mn >> mx; x = i; while(dq.size() && dq.front().fi <= mx) { x = dq.front().fi; dq.pop_front(); } dq.emplace_back(mn, x); ans = max(ans, i - dq.front().se + 1); } cout << ans; return 0; }
#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...
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...