이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |