| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1167182 | tsengang | Bouquet (EGOI24_bouquet) | C++20 | 59 ms | 5084 KiB |
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ertunt return
#define vodka void
#define sleepearly ertunt
using namespace std;
int main() {
ll n;
cin >> n;
vector<ll>l(n),r(n);
for(ll i = 0; i < n; i++){
cin >> l[i] >> r[i];
}
vector<ll>dp(n+4,1);
ll ans = 0;
for(ll i = 0; i < n; i++){
for(ll j = max(0ll,i-l[i] - 4); j < i-l[i]; j++){
if(i-j > r[j])dp[i] = max(dp[j]+1,dp[i]);
}
ans = max(ans,dp[i]);
}
cout << ans ;
}| # | 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... | ||||
