# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
605216 | MohamedAliSaidane | Packing Biscuits (IOI20_biscuits) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
#define pb push_back
#define popb pop_back
#define all(x) (x).begin(),(x).end()
int k;
vll A;
ll x;
ll count_tastiness(ll X, vll a)
{
A = a;
x = X;
k = A.size();
ll ans = 1ll;
for(ll y = 1; y <= 1e5; y ++)
{
vll B = A;
bool flag = true;
for(int i = 0; i < x; i ++)
{
ll cur= y;
for(int j = k - 1; j >= 0; j --)
{
while(cur >= (1 << j) && B[j] > 0)
{
cur -= (1 << j);
B[j]--;
}
}
if(cur > 0)
{
flag = false;
break;
}
}
ans += (flag);
}
return ans;
}
/*
int32_t main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
}