# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
823895 | 2023-08-13T09:50:49 Z | drdilyor | Packing Biscuits (IOI20_biscuits) | C++17 | 1 ms | 596 KB |
#include<bits/stdc++.h> #include "biscuits.h" using namespace std; using ll = long long; const int T = 120; long long count_tastiness(long long x, std::vector<long long> a) { assert(x == 1); int k = a.size(); a.resize(T+1); vector<int> pos(T+1); ll cur = 0; for (int i = 0; i <= T; i++) { if (a[i] > 1) { ll d = (a[i] - 1) / 2; a[i] -= d; a[i+1] += d; } } // for (ll i : a) cout << i << ' '; cout << endl; vector<ll> ans(T+2); ans[0] = 1; for (int i = 0; i <= T; i++) { if (a[i]) { ans[i+1] = ans[i] * 2; } else { ans[i+1] = ans[i]; for (int j = i-1; j >= 0; j--) { if (a[j] == 0) break; if (a[j] == 2) { ans[i+1] += ans[j-1 + 1]; } } } } // for (ll i : ans) cout << i << ' '; cout << endl; return ans.back(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 300 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 596 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |