Submission #638854

#TimeUsernameProblemLanguageResultExecution timeMemory
638854AmirHRabbit Carrot (LMIO19_triusis)C++14
0 / 100
1 ms324 KiB
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define pb push_back #define faster ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) const int MAX_N=2e5+25; int main() { faster; int n, m; cin >> n >> m; vector<int> a; a.pb(0); for(int i = 1; i <= n; i++) { int x; cin >> x; a.pb(x); } int sum = 0; for(int i = 1; i <= n; i++) { if(a[i] - a[i - 1] > m) { a[i] = a[i - 1] + m; sum ++; } } cout << sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...