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 main() {
long long int n=0;
long long int m=0;
long long int a=0;
long long int i=0;
long long int tot=0;
cin>>n>>m;
long long int arr[n];
for(i=0;i<n;i++) {
cin>>a;
arr[i]=a;
}
a=0;
for(i=0;i<n;i++) {
if((m+a) < arr[i]) {
a=arr[i];
tot++;
}
a=arr[i];
}
cout<<tot<<endl;
return 0;
}
# | 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... |