Submission #72401

#TimeUsernameProblemLanguageResultExecution timeMemory
72401https://blog.naver.com/nywoo19 (#118)Nectar with Coconut Jelly (FXCUP3_nectar)C++17
15 / 100
50 ms704 KiB
#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)

nectar.cpp: In function 'int main()':
nectar.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld %lld %lld", &q, &w, &e, &r);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...