Submission #72466

#TimeUsernameProblemLanguageResultExecution timeMemory
72466인프라웨어 상한가 가주세요. 물렸어요 (#118)Nectar with Coconut Jelly (FXCUP3_nectar)C++14
15 / 100
2069 ms744 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...