# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
805658 | AmrT | Rabbit Carrot (LMIO19_triusis) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define lop(i,a,b) for(ll i = a; i < b; i++)
using namespace std;
ll mod = 1e9 + 7;
signed main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, k; cin >> n >> k;
ll arr[n + 1] = {}, ans = 0;
lop(i, 0, n) cin >> arr[i + 1];
for(int i = 0; i < n; i++){
if(arr[i] + k < arr[i + 1]) ans++, arr[i + 1] = arr[i] + k;
}
cout << ans;
return 0;
}