| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1171231 | FZ_Laabidi | Bouquet (EGOI24_bouquet) | C++20 | 40 ms | 2968 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<pair<int, int>> flowers(n+1, {INT_MAX, INT_MAX});
vector<int> dp(n, 1);
for(int i = 0; i < n; i++)
cin >> flowers[i].first >> flowers[i].second;
for (int i=0; i<n; i++) {
for (int j=max(0,i-5); j<i; j++) {
if (j+max(flowers[j].second, flowers[i].first)<i)
dp[i]= max(dp[i], dp[j]+1);
}
}
cout << *max_element(dp.begin(), dp.end())<< 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... | ||||
