Submission #521512

#TimeUsernameProblemLanguageResultExecution timeMemory
521512penguin133Rabbit Carrot (LMIO19_triusis)C++14
0 / 100
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; int A[200005], ans; int main(){ int n,m;cin >> n >> m; for(int i=1;i<=n;i++)cin >> A[i]; for(int i=1;i<=n;i++){ if(A[i] <= A[i-1] + m)continue; else ans++, A[i] = A[i-1] + m; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...