| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1164715 | Ghulam_Junaid | Rabbit Carrot (LMIO19_triusis) | C++20 | 8 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(0); cin.tie(0);
ll n, m;
cin >> n >> m;
ll dp[n + 5] = {}, ans = 0;
for (ll i = 1; i <= n; i ++){
ll x;
cin >> x;
if (dp[ans] + m < x)
ans++;
for (ll j = i; j >= ans; j --){
if (!j) dp[j] = x;
else{
dp[j] = dp[j - 1] + m;
if (dp[j] + m >= x) dp[j] = max(dp[j], x);
}
}
}
cout << ans << 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... | ||||
