# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
900249 | 2024-01-08T01:58:40 Z | nguyentunglam | Packing Biscuits (IOI20_biscuits) | C++17 | 1000 ms | 580 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]; long long count_tastiness(long long x, vector<long long> A) { for(int i = 0; i <= 60; i++) a[i] = 0; for(int i = 0; i < A.size(); i++) a[i] = A[i]; long long ret = 1; for(int y = 1; y <= 1e5; y++) { long long tmp = y; long long cur = 0; for(int j = 60; j >= 0; j--) { cur *= 2; if (cur > 1e5) break; if (tmp >> j & 1) cur += x; cur = max(0LL, cur - a[j]); } if (!cur) ret++; // if (!cur) cout << y << endl; } 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 | Correct | 102 ms | 408 KB | Output is correct |
2 | Correct | 77 ms | 580 KB | Output is correct |
3 | Correct | 96 ms | 404 KB | Output is correct |
4 | Correct | 105 ms | 348 KB | Output is correct |
5 | Correct | 105 ms | 344 KB | Output is correct |
6 | Correct | 108 ms | 408 KB | Output is correct |
7 | Correct | 107 ms | 412 KB | Output is correct |
8 | Correct | 107 ms | 408 KB | Output is correct |
9 | Correct | 106 ms | 420 KB | Output is correct |
10 | Correct | 78 ms | 344 KB | Output is correct |
11 | Correct | 82 ms | 344 KB | Output is correct |
12 | Correct | 108 ms | 416 KB | Output is correct |
13 | Correct | 105 ms | 412 KB | Output is correct |
14 | Correct | 94 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 102 ms | 348 KB | Output is correct |
2 | Incorrect | 62 ms | 344 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 81 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1035 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 102 ms | 408 KB | Output is correct |
2 | Correct | 77 ms | 580 KB | Output is correct |
3 | Correct | 96 ms | 404 KB | Output is correct |
4 | Correct | 105 ms | 348 KB | Output is correct |
5 | Correct | 105 ms | 344 KB | Output is correct |
6 | Correct | 108 ms | 408 KB | Output is correct |
7 | Correct | 107 ms | 412 KB | Output is correct |
8 | Correct | 107 ms | 408 KB | Output is correct |
9 | Correct | 106 ms | 420 KB | Output is correct |
10 | Correct | 78 ms | 344 KB | Output is correct |
11 | Correct | 82 ms | 344 KB | Output is correct |
12 | Correct | 108 ms | 416 KB | Output is correct |
13 | Correct | 105 ms | 412 KB | Output is correct |
14 | Correct | 94 ms | 348 KB | Output is correct |
15 | Correct | 102 ms | 348 KB | Output is correct |
16 | Incorrect | 62 ms | 344 KB | Output isn't correct |
17 | Halted | 0 ms | 0 KB | - |