Submission #432803

#TimeUsernameProblemLanguageResultExecution timeMemory
432803MOUF_MAHMALATPacking Biscuits (IOI20_biscuits)C++14
0 / 100
6 ms332 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; vector<ll>a; ll x,n=61,dp[65][65]; ll best(int d,ll k) { if(d==61) return 1; k+=a[d]; ll lg=log2(k); ll &r=dp[d][lg]; if(r!=-1) return r; if(k>=x) return r=best(d+1,k/2)+best(d+1,(k-x)/2); return r=best(d+1,k/2); } long long count_tastiness(ll X, vector<ll> A) { x=X,a=A,a.resize(n); memset(dp,-1,sizeof dp); return best(0,0); }
#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...