Submission #72324

#TimeUsernameProblemLanguageResultExecution timeMemory
72324 (#118)Nectar with Coconut Jelly (FXCUP3_nectar)C++17
15 / 100
2060 ms580 KiB
#include<cstdio> #include<algorithm> using namespace std; int N,J,R,T; int ans[100000]; int pending[100000]; int main(){ scanf("%d%d%d%d",&N,&J,&R,&T); for(int i=0;i<N;i++) ans[i] = J; for(int iter=0;iter<T;iter++){ for(int i=1;i<N;i++){ pending[i] = ans[i]/R; if(ans[i]%R) pending[i]++; } for(int i=1;i<N;i++){ ans[i-1] += pending[i]; ans[i] -= pending[i]; } } for(int i=N-1;i>=0;i--) printf("%d\n", ans[i]); }

Compilation message (stderr)

nectar.cpp: In function 'int main()':
nectar.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d%d",&N,&J,&R,&T);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...