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;
#define ll long long
int main(){
//ios::sync_with_stdio(false);
//cin.tie(0);
ll n,m;
cin >> n >> m;
vector<ll> v(n);
for(auto &i : v){cin >> i;}
ll curr=0,next;
ll ans=0;
for(ll i=0;i<n;i++){
next=v[i];
if(next-curr>m){
ans++;
curr+=m;
}
else{
curr=next;
}
}
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... |