# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
333197 | nickmet2004 | 비스킷 담기 (IOI20_biscuits) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll dp[61] , Pr[61];
ll count_tastiness(ll X , vector<ll> a){
int n = a.size();
for(int i = 0; i < n; ++i) if(i)Pr[i] = Pr[i - 1] + a[i] * (1ll << i);
dp[0] = 1;
for(int k = 1; k < 61; ++k){
ll S = min(Pr[i] , (1ll << k) - 1);
for(int j = 60; ~i; --i){
if(S >> j & 1) dp[i] += dp[j];
}
if(a[k -1])dp[i]++;
}
return dp[60];
}