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 <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <math.h>
#include <memory.h>
using namespace std;
#define MAX_SIZE 100
#define InF 0x7fffffff
#define CEnDL "\n"
#define ll long long
int main() {
cin.tie(0);
std::ios::sync_with_stdio(false);
int n; cin >> n; // can area
int j; cin >> j; // count of jelly;
int r; cin >> r; // after bunpo
int second; // time;
cin >> second;
vector<int> arr(n);
for (int i = 0; i < n; i++)
arr[i] = j;
while (second--) {
vector<int> brr(n);
for (int i = 0; i < n-1; i++) {
int cand = arr[i];
int remain = ceil((float)cand / r);
if(arr[i] > 0)
arr[i] -= remain;
brr[i+1] = remain;
}
for (int i = 0; i < n - 1; i++) {
arr[i+1] += brr[i + 1];
}
}
for (int i = 0; i < n; i++) {
cout << arr[i] << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |