Submission #895063

#TimeUsernameProblemLanguageResultExecution timeMemory
895063LitusianoRabbit Carrot (LMIO19_triusis)C++17
0 / 100
0 ms348 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...