#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 |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |