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>
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 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... |