# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
730173 | danikoynov | Packing Biscuits (IOI20_biscuits) | C++14 | 1069 ms | 340 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 "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, b[100];
long long count_tastiness(long long x, vector<long long> a)
{
n = a.size();
ll sum = 0;
for (int i = 0; i < n; i ++)
{
sum += a[i] * ((ll)(1) << i);
}
ll ans = 0;
for (ll d = 0; d <= sum; d ++)
{
for (int i = 0; i < n; i ++)
b[i] = a[i];
bool tf = true;
for (ll bit = 0; bit < 20; bit ++)
{
if ((d & (1 << bit)) > 0)
{
if (b[bit] < x)
{
tf = false;
break;
}
b[bit] -= x;
}
b[bit + 1] = b[bit + 1] + b[bit] / 2;
}
if (tf)
ans ++;
}
cout << ans << endl;
return ans;
}
Compilation message (stderr)
# | 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... |