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;
long long x, k;
vector<long long> a, pre;
long long count_tastiness(long long X, vector<long long> A)
{
x = X, a = A, k = A.size();
long long res = 0, S = 0;
for (int i = 0; i < k; i++) S += (a[i] << i);
for (long long y = 0; y <= 100000; y++)
{
a = A;
if (x * y > S) break;
int s = 0, f = 1;
for (long long j = 0; j < 60; j++)
{
if (j < k) s += a[j] << j;
if ((y >> j & 1))
{
if ((x << j) > s)
{
f = 0;
break;
}
s -= (x << j);
}
}
res += f;
}
return res;
}
# | 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... |