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