| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1326251 | AzamatRustamov | Bouquet (EGOI24_bouquet) | C++20 | 80 ms | 2736 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> l(n), r(n);
for (int i=0; i<n; i++) {
cin >> l[i] >> r[i];
}
// let dp(i) be maximum # of
// flowers you can take from
// first i flowers
// then answer is dp[n]
vector<int> dp(n+1);
for (int i=0; i<n; i++) {
dp[i+1] = dp[max(0, i-l[i])] + 1;
}
cout << dp[n];
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
