| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1229183 | unnick | Bouquet (EGOI24_bouquet) | C++20 | 60 ms | 416 KiB |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// #define dbg(v) cout << #v << " = " << v << "\n";
int main() {
int n;
cin >> n;
// vector<int> best(n, 0);
int last = -2000000;
int v = 0;
for (int i = 0; i < n; i++) {
int l, r;
cin >> l >> r;
// dbg(i);
// dbg(l);
// dbg(last);
if (i-l > last) {
last = i;
v++;
}
// if (i > 0) best[i] = best[i-1];
// best[i] = max(best[i], (i-l-1 >= 0 ? best[i-l-1] : 0)+1);
}
// for (int v: best) dbg(v);
// cout << best.back() << "\n";
cout << v << "\n";
return 0;
}
| # | 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... | ||||
