# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
748995 | DJeniUp | Packing Biscuits (IOI20_biscuits) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
map<ll,ll>m[67];
ll k,n,d[67];
ll S(ll x,ll y){
if(x>=k && y<n)return 1;
y+=d[x];
if(y<n)return S(x+1,y/2);
//cout<<"! "<<x<<" "<<y<<endl;
if(m[x][y]!=0)return m[x][y];
m[x][y]+=S(x+1,y/2);
if(y>=n)m[x][y]+=S(x+1,(y-n)/2);
//cout<<x<<" "<<y<<" "<<m[x][y]<<endl;
return m[x][y];
}
long long count_tastiness(long long x, std::vector<long long> a) {
k=a.size();
n=x;
for(int i=0;i<=65;i++){
m[i].clear();
d[i]=0;
}
for(int i=0;i<k;i++){
d[i]=a[i];
}
//cout<<"! "<<S(0,0)<<endl;
return S(0,0);
}