Submission #72041

#TimeUsernameProblemLanguageResultExecution timeMemory
72041BOJ 8481 (#118)Nectar with Coconut Jelly (FXCUP3_nectar)C++17
15 / 100
2008 ms768 KiB
#include <bits/stdc++.h> #define dbgv(v) {for(auto x:v)cout<<x<<' ';cout<<'\n';} #define entire(v) v.begin(),v.end() typedef long long ll; using namespace std; void OJize(){ cin.tie(NULL); ios_base::sync_with_stdio(false); #ifdef jh freopen("input.txt", "r", stdin); #endif } int main(){OJize(); int n, j, r, t; cin>>n>>j>>r>>t; vector<int> drink(n, j); for(int time=0; time<t; time++){ for(int i=n-2; i>=0; i--){ int movedown = drink[i]/r; if(drink[i]%r) movedown++; drink[i]-= movedown; drink[i+1]+= movedown; } } for(int x: drink) cout<<x<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...