# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72401 | https://blog.naver.com/nywoo19 (#118) | Nectar with Coconut Jelly (FXCUP3_nectar) | C++17 | 50 ms | 704 KiB |
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<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
ll a[1001];
ll q, w, e, r;
int main()
{
scanf("%lld %lld %lld %lld", &q, &w, &e, &r);
for (int i = 1; i <= q; i++)
a[i] = w;
for (int i = 0; i < r; i++)
{
for (int y = q; y >= 1; y--)
{
ll t = a[y - 1] / e;
if (a[y - 1] % e)
t++;
a[y] += t;
a[y - 1] -= t;
}
}
for (int i = 1; i <=q; i++)
printf("%lld\n", a[i]);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |