# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305001 | arnold518 | Packing Biscuits (IOI20_biscuits) | C++14 | 1136 ms | 1051320 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;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll X, A[100], P[100];
ll count_tastiness(ll _X, vector<ll> _A)
{
X=_X;
memset(A, 0, sizeof(A));
for(int i=0; i<_A.size(); i++) A[i]=_A[i];
for(int i=0; i<60; i++) P[i]=(1ll<<i)*A[i];
for(int i=1; i<60; i++) P[i]+=P[i-1];
for(int i=0; i<60; i++) P[i]/=X;
vector<ll> V;
V.push_back(0);
for(int i=0; i<60; i++)
{
int t=V.size();
for(int j=0; j<t; j++) V.push_back(V[j]+(1ll<<i));
while(!V.empty() && V.back()>P[i]) V.pop_back();
}
return V.size();
}
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... |