Submission #1133592

#TimeUsernameProblemLanguageResultExecution timeMemory
1133592alterioPacking Biscuits (IOI20_biscuits)C++20
0 / 100
1095 ms328 KiB
#include <bits/stdc++.h> #include "biscuits.h" #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("Ofast,unroll-loops") using namespace std; #define ll long long ll count_tastiness(ll x, vector<ll> a) { ll ans = 0, sum = 0; int n = a.size(); for (ll i = 0; i < n; i++) sum += (1LL << i) * a[i]; for (ll y = 0; y <= sum / x; y++) { vector<ll> c = a; bool pos = 1; for (int j = 0; j < x; j++) { ll cur = 0; for (int l = c.size() - 1; l >= 0; l--) { ll diff = y - cur; ll times = diff / (1LL << l); times = min(times, c[l]); c[l] -= times; cur += times * (1LL << l); } if (cur != y) { pos = 0; break; } } ans += pos; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...