제출 #432485

#제출 시각아이디문제언어결과실행 시간메모리
432485MOUF_MAHMALAT비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1094 ms1120 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; vector<ll>a,b; ll x,n=61,lg[100009],p[65]; long long count_tastiness(ll X, vector<ll> A) { x=X,a=A,a.resize(n); if(lg[2]==0) { for(ll i=2; i<=1e5; i++) lg[i]=lg[i/2]+1; } ll ans=0; for(ll i=0; i<=1e5; i++) { b=a; for(ll j=0; j<=lg[i]; j++) { if((1<<j)&i) { if(b[j]<x) break; b[j]-=x; } b[j+1]+=b[j]/2; if(j==lg[i]) ans++; } } 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...