# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834170 | 2023-08-22T11:30:48 Z | faruk | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 340 KB |
#include "biscuits.h" #include <bits/stdc++.h> #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; const ll maxsum = 1e5+1; const ll maxsiz = 71; long long count_tastiness(long long x, std::vector<long long> a) { if (x == 1) { ll out = 1; a.resize(maxsiz); for (int i = 0; i < a.size()-1; i++) { ll to_remove = 0; if (a[i] % 2) to_remove = a[i] - 1LL; else if (a[i] > 0) to_remove = a[i] - 2LL; a[i + 1] += to_remove / 2LL; a[i] -= to_remove; } ll has_l = 0, hasnt_l = 1; for (int i = 0; i < a.size(); i++) { if (a[i] == 0) { out *= has_l + hasnt_l; has_l = 0, hasnt_l = 1; } else { if (a[i] == 2) has_l += hasnt_l; hasnt_l *= 2LL; } } return out; } x = 1; ll out = 0; a.resize(61); for (int val = 0; val < maxsum; val++) { vector<ll> curr = a; int num = 0; bool ok = true; for (ll a = 0; a < curr.size(); a++) { num += curr[a]; if ((val & (1LL <<a)) != 0) { if (num < x) ok = false; else num -= x; } num /= 2; } if (ok) out++; } return out; } // 0 1 2 3 4 5 6 7 8 9 10
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 135 ms | 284 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 1 ms | 212 KB | Output is correct |
6 | Correct | 0 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 109 ms | 276 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1092 ms | 340 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 135 ms | 284 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |