# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72462 | 2018-08-26T08:20:42 Z | 인프라웨어 상한가 가주세요. 물렸어요(#2188, c4big, cepiloth) | Key of Impassable Doors (FXCUP3_key) | C++14 | 0 ms | 0 KB |
#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; }