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;
int A[1000], B[1000], N, J, R, T;
int ceil(int x, int y){
return (x/y) + (x%y == 0 ? 0 : 1);
}
int main(){
ios::sync_with_stdio(false); cin.tie(nullptr);
cin >> N >> J >> R >> T;
for (int i=0; i<N; i++){
A[i] = J;
}
for (int t=0; t<T; t++){
for (int i=0; i<N; i++) B[i] = 0;
for (int i=0; i<N-1; i++){
int num = ceil(A[i], R);
B[i] -= num;
B[i+1] += num;
}
for (int i=0; i<N; i++) A[i] += B[i];
}
for (int i=0; i<N; i++) cout << A[i] << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |