Submission #1047014

#TimeUsernameProblemLanguageResultExecution timeMemory
1047014MarwenElarbiPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1028 ms348 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]*(1<<i); } if(x>cur/x) return 1; 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 = 16; k >= 0; k--) { if(!((1<<k)&i)) continue; bool cur=false; for (int t = k; t >= 0; t--) { if(b[t]>=(1<<(k-t))){ b[t]-=(1<<(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...