| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1170402 | FZ_Laabidi | Bouquet (EGOI24_bouquet) | C++20 | 62 ms | 1984 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 time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
