#include <bits/stdc++.h>
#define dbgv(v) {for(auto x:v)cout<<x<<' ';cout<<'\n';}
#define entire(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
void OJize(){
cin.tie(NULL); ios_base::sync_with_stdio(false);
#ifdef jh
freopen("input.txt", "r", stdin);
#endif
}
int main(){OJize();
int n, j, r, t; cin>>n>>j>>r>>t;
vector<int> drink(n, j);
for(int time=0; time<t; time++){
for(int i=n-2; i>=0; i--){
int movedown = drink[i]/r;
if(drink[i]%r) movedown++;
drink[i]-= movedown;
drink[i+1]+= movedown;
}
}
for(int x: drink) cout<<x<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
468 KB |
Output is correct |
4 |
Correct |
2 ms |
520 KB |
Output is correct |
5 |
Correct |
2 ms |
524 KB |
Output is correct |
6 |
Correct |
3 ms |
584 KB |
Output is correct |
7 |
Correct |
14 ms |
696 KB |
Output is correct |
8 |
Correct |
17 ms |
700 KB |
Output is correct |
9 |
Correct |
17 ms |
748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
468 KB |
Output is correct |
4 |
Correct |
2 ms |
520 KB |
Output is correct |
5 |
Correct |
2 ms |
524 KB |
Output is correct |
6 |
Correct |
3 ms |
584 KB |
Output is correct |
7 |
Correct |
14 ms |
696 KB |
Output is correct |
8 |
Correct |
17 ms |
700 KB |
Output is correct |
9 |
Correct |
17 ms |
748 KB |
Output is correct |
10 |
Execution timed out |
2008 ms |
768 KB |
Time limit exceeded |
11 |
Halted |
0 ms |
0 KB |
- |