# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
900248 | 2024-01-08T01:55:16 Z | nguyentunglam | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 424 KB |
#include<bits/stdc++.h> #define fi first #define se second #define endl "\n" #define ii pair<int, int> using namespace std; const int N = 110; long long a[N], b[N]; long long count_tastiness(long long x, vector<long long> A) { for(int i = 0; i < A.size(); i++) b[i] = a[i] = A[i]; long long ret = 1; for(long long y = 1; y <= 10; y++) { bool ok = 1; for(int j = 0; j <= 60; j++) a[j] = b[j]; for(int loop = 1; loop <= x; loop++) { long long cur = 0; for(int j = 60; j >= 0; j--) { cur *= 2; if (cur > 1e5) { ok = 0; break; } if (y >> j & 1) cur++; long long cnt = min(cur, a[j]); cur -= cnt; a[j] -= cnt; } ok &= cur == 0; } // if (ok) cout << y << endl; ret += ok; } return ret; } #ifdef ngu int main() { freopen ("task.inp", "r", stdin); freopen ("task.out", "w", stdout); int q; cin >> q; while (q--) { long long k, x; cin >> k >> x; vector<long long> a(k); for(int i = 0; i < k; i++) cin >> a[i]; cout << count_tastiness(x, a) << endl; } } #endif // ngu
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 78 ms | 424 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1079 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |