# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
673315 | Hanksburger | Packing Biscuits (IOI20_biscuits) | C++17 | 1 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;
map<long long, long long> mp;
long long s[60], x;
long long f(long long n)
{
if (n<=0 || mp[n])
return mp[n];
long long l=log2(n-0.5);
return mp[n]=f(1<<l)+f(min(n, 1+s[l]/x)-(1<<l));
}
long long count_tastiness(long long X, vector<long long> A)
{
mp.clear();
x=X, mp[1]=1, s[0]=A[0];
for (long long i=1; i<A.size(); i++)
s[i]=s[i-1]+(A[i]<<i);
return f(1<<A.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... |