제출 #1170402

#제출 시각아이디문제언어결과실행 시간메모리
1170402FZ_LaabidiBouquet (EGOI24_bouquet)C++20
8 / 100
62 ms1984 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> flowers(n, {INT_MAX, INT_MAX}); for(int i = 0; i < n; i++) cin >> flowers[i].first >> flowers[i].second; int c=0, i=0; while (i<n) { i+=flowers[i].first+1; c++; } /* for (int j=0; j<n; j++) { int k=j, cc=0; while (k>0) { cc++; k-=flowers[k].first+1; } k = j; while (k<n) { k+=flowers[k+1].first+1; cc++; } c = max(cc, c); }*/ cout << c << endl; }
#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...