제출 #1047018

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