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 "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define X first
#define Y second
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define SZ(a) ((int)a.size())
vector<ll> arr;
ll ans,X;
void dfs(int u,ll hv)
{
if(u==SZ(arr))
return ++ans,void();
hv+=arr[u],dfs(u+1,hv/2);
if(hv>=X)
dfs(u+1,(hv-X)/2);
}
ll count_tastiness(ll x, vector<ll> a)
{
ans=0,X=x;
arr.swap(a);
dfs(0,0);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |