Submission #544651

#TimeUsernameProblemLanguageResultExecution timeMemory
544651pokmui9909공주님의 정원 (KOI11_flower)C++17
18 / 18
44 ms2048 KiB
#include <bits/stdc++.h> using namespace std; pair<int, int> ar[100001]; int main() { cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int n; cin >> n; for(int i = 0; i < n; i++) { int a, b, c, d; cin >> a >> b >> c >> d; ar[i] = {100 * a + b, 100*c + d}; } int ans = 0; int now = 301; while(1) { if(now > 1130) break; int k = 0; for(int i = 0; i < n; i++) { if(ar[i].first <= now && now < ar[i].second) k = max(k, ar[i].second); } if(now >= k) { cout << 0; return 0; } now = k; ans++; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...