Submission #422166

#TimeUsernameProblemLanguageResultExecution timeMemory
422166MonchitoPacking Biscuits (IOI20_biscuits)C++14
9 / 100
1083 ms332 KiB
#include "biscuits.h" using namespace std; using ll = long long; bool can(ll y, ll x, vector<ll> a){ int n = __builtin_popcountll(y); for(int i=0; true; i++){ if(n == 0) break; if((y & (1LL<<i)) == 0){ a[i+1] += a[i] / (ll)2; continue; } if(a[i] < x) return false; a[i+1] += (a[i] - x) / (ll)2; n--; } return true; } ll count_tastiness(ll x, vector<ll> a) { ll ret=1; vector<ll> b(64, 0); for(int i=0; i<(int)a.size(); i++) b[i] = a[i]; for(ll y = 1; y <= (ll)1e5; y++){ if(can(y, x, b)) ret++; } return ret; }
#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...