제출 #1047020

#제출 시각아이디문제언어결과실행 시간메모리
1047020MarwenElarbi비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1092 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]*(1LL<<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 = 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...