This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifndef ARTHUR_LOCAL
#include "biscuits.h"
#endif
#ifdef ARTHUR_LOCAL
#include <bits/stdc++.h>
#endif
using namespace std;
using ll = long long;
#define len(x) int((x).size())
ll count_tastiness(ll x, vector<ll> A)
{
return 5LL;
ll ans = 0LL;
int MXIT = 100000;
#ifdef ARTHUR_LOCAL
MXIT=1000;
#endif
while(len(A) < 20) A.push_back(0);
for(int i=0; i<=MXIT; i++)
{
vector<ll> curA = A;
bool w=1;
for(int b=0; b<20; b++)
{
if((i & (1<<b)) != 0)
{
if(b >= len(A)) w=0;
else
{
if(curA[b] < x) w=0;
else curA[b] -= x;
}
}
if(b+1 < len(A)) curA[b+1] += ll(curA[b]/2LL);
}
if(w) {
//cout << i << endl;
ans++;
}
}
return ans;
}
#ifdef ARTHUR_LOCAL
int main()
{
cout << count_tastiness(2, {1}) << endl;
}
#endif
# | 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... |