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;
ll k,X;
ll A[1001]={0};
ll solve(int ptr, ll val){
if(val==0&&ptr>=X){
// cout << ptr << ' ' << val << ' ' << 1 << '\n';
return 1;
}
ll sus1=0,sus2=0;
sus1=solve(ptr+1,A[ptr+1]+(val>>1));
if(val-X>=0){
sus2=solve(ptr+1,A[ptr+1]+((val-X)>>1));
}
// cout << ptr << ' ' << val << ' ' << sus1+sus2 << '\n';
return sus1+sus2;
}
ll count_tastiness(ll x, vector<ll> a) {
// cout << "\n\n";
k=a.size();
for(int i=0;i<k;i++)A[i]=a[i];
X=x;
return solve(0,A[0]);
return 0;
}
# | 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... |