Submission #1047024

#TimeUsernameProblemLanguageResultExecution timeMemory
1047024MarwenElarbiPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1095 ms436 KiB
#include <bits/stdc++.h> using namespace std; #include "biscuits.h" long long count_tastiness(long long x, std::vector<long long> a) { int n=a.size(); long long cur=0; for (int i = 0; i < n; ++i) { cur+=a[i]*(1LL<<i); } int ans=1; for (int i = 1; i <= cur/x; ++i) { bool test=true; vector<long long> b=a; for (int j = 0; j < x; ++j) { for (int k = n-1; k >= 0; k--) { if(!((1LL<<k)&i)) continue; bool cur=false; for (int t = k; t >= 0; t--) { if(b[t]>=(1LL<<(k-t))){ b[t]-=(1LL<<(k-t)); cur=true; break; } } test&=cur; } } ans+=test; } 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...