| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360630 | simplemind_31 | Rabbit Carrot (LMIO19_triusis) | C++20 | 1095 ms | 1860 KiB |
#include <bits/stdc++.h>
using namespace std;
int n,t,maxi=1;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin >> n >> t;
int nums[n+1],dp[n+1];// maximum number of unchanged si hasta i es unchanged
fill(dp,dp+(n+1),-1e9);
dp[0]=1;
nums[0]=0;
for(int i=1;i<=n;i++)cin >> nums[i];
for(int i=1;i<=n;i++){
for(int j=i-1;j>=0;j--){
// puedo llegar desde j hasta i?
// hay i-j espacios
// puede saltar a (i-j)*t;
if(nums[j]+(i-j)*t>=nums[i])maxi=max(dp[i]=max(dp[i],dp[j]+1),maxi);
}
}
cout << n+1-maxi;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
