제출 #432785

#제출 시각아이디문제언어결과실행 시간메모리
432785MOUF_MAHMALAT비스킷 담기 (IOI20_biscuits)C++14
21 / 100
1085 ms43648 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; vector<ll>a; map<pair<int,ll>,bool>b; map<pair<int,ll>,ll>mp; ll x,n=61; ll best(int d,ll k) { if(d==61) return 1; pair<int,ll>id={d,k}; if(b[id]) return mp[id]; b[id]=1; ll &r=mp[id]; k+=a[d]; 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); b.clear(),mp.clear(); 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...