제출 #534254

#제출 시각아이디문제언어결과실행 시간메모리
534254ac2hu무제 (POI11_tem)C++14
0 / 100
1083 ms25472 KiB
#include <bits/stdc++.h> #ifdef DEBUG #include "../templates/debug.h" #else #define deb(x...) #endif using namespace std; signed main() { iostream::sync_with_stdio(false); cin.tie(nullptr);cout.tie(nullptr); int n;cin >> n; vector<pair<int,int>> a(n); for(auto &e : a)cin >> e.first >> e.second; int l = 1,r = n; auto check = [&](int mid) -> bool{ for(int i = 0;i<n - mid + 1;i++){ int cur = 0; for(int j = i;j<mid + i;j++){ cur = max(cur, a[j].first); if(cur > a[j].second){ goto bad; } } return true; bad: continue; } return false; }; while(l < r){ int mid = (l + r + 1)/2; // cout << mid << "\n"; if(check(mid)){ l = mid; } else r = mid - 1; } cout << l << "\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...
#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...