# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433020 | 2021-06-18T17:56:42 Z | lior5654 | Packing Biscuits (IOI20_biscuits) | C++17 | 1 ms | 332 KB |
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pl; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pl> vpl; typedef vector<vpl> vvpl; typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pi> vpi; typedef vector<vpi> vvpi; #define rep(i, n) for(int i = 0; i < n; ++i) #define all(c) (c.begin()), (c.end()) #define pb push_back #define eb emplace_back #define fi first #define se second const int maxk = 61; ll x; ll k; ll a[maxk] = { 0 }; void init_input(ll X, const vl& A) { x = X; k = A.size(); rep(i, k) {a[i] = A[i];} } ll count_tastiness(ll X, vl A) { init_input(X, A); ll res = 1; ll num_blocks = a[0] + 1; ll block_val = 1; ll dist = 1; ll mx = num_blocks - 1; for(ll i = 1; i < k; ++i) { //if(!a[i]) continue; if(mx < (1ll<<i)) { block_val = num_blocks * block_val; num_blocks = a[i]+1; dist = 1ll<<i; } else { num_blocks += (a[i] * ((1ll<<i) / dist)); } mx += a[i] * (1ll<<i); } return num_blocks * block_val; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 288 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |