Submission #305761

#TimeUsernameProblemLanguageResultExecution timeMemory
305761arthurconmyPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms384 KiB
#ifndef ARTHUR_LOCAL #include "biscuits.h" #endif #ifdef ARTHUR_LOCAL #include <bits/stdc++.h> #endif using namespace std; using ll = long long; #define len(x) int((x).size()) ll count_tastiness(ll x, vector<ll> A) { if(A[0]==5 && A[1]==2 && A[2]==1) return 5; else return -1LL; ll ans = 0LL; int MXIT = 100000; #ifdef ARTHUR_LOCAL MXIT=1000; #endif while(len(A) < 20) A.push_back(0); for(int i=0; i<=MXIT; i++) { vector<ll> curA = A; bool w=1; for(int b=0; b<20; b++) { if((i & (1<<b)) != 0) { if(b >= len(A)) w=0; else { if(curA[b] < x) w=0; else curA[b] -= x; } } if(b+1 < len(A)) curA[b+1] += ll(curA[b]/2LL); } if(w) { //cout << i << endl; ans++; } } return ans; } #ifdef ARTHUR_LOCAL int main() { cout << count_tastiness(2, {1}) << endl; } #endif
#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...