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 int long long
signed main(){
int n,h; cin>>n>>h;
int ans = 0;
vector<int> v(n+1,0); //for(int& i : v) cin>>i
// for(int i = 1; i<=n; i++){
// cin>>v[i];
// if(v[i] > i*h){
// ans++;
// v[i] = v[i-1] + h;
// }
// }
for(int i = 1; i<=n; i++){
if(v[i] > v[i-1]+h){
v[i] = v[i-1]+h;
ans++;
}
}
cout<<ans<<endl;
}
# | 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... |