제출 #1022316

#제출 시각아이디문제언어결과실행 시간메모리
1022316JakobZorz비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1068 ms1236 KiB
#include"biscuits.h" #include<unordered_map> #include<iostream> typedef long long ll; using namespace std; ll x; ll coins[62]; ll s[62]; ll count(ll n){ if(n==1) return 1; if(n<1) return 0; int i=0; ll pw2=2; while(pw2<n){ pw2*=2; i++; } pw2/=2; return count(pw2)+count(min(n,s[i]/x+1)-pw2); } ll count_tastiness(ll X,vector<ll>a){ x=X; for(int i=0;i<62;i++){ coins[i]=0; } for(int i=0;i<(int)a.size();i++) coins[i]=a[i]; for(int i=0;i<62;i++){ ll num=(coins[i]-x)/2; if(num>0){ coins[i+1]+=num; coins[i]-=2*num; } s[i]=(1LL<<i)*coins[i]; if(i) s[i]+=s[i-1]; } return count(1LL<<62); }
#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...