| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 305773 | daniel920712 | Packing Biscuits (IOI20_biscuits) | C++14 | 1110 ms | 188280 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 <stdio.h>
#include <string.h>
#include <set>
using namespace std;
long long con[105]={0},N,x;
set < long long > all;
set < long long > have[105];
void F(long long here,long long c,long long now)
{
if(here>=N&&c==0||have[here].find(now)!=have[here].end()) return ;
have[here].insert(now);
if(c>=x)
{
all.insert(now+(long long) (1<<here));
F(here+1,(c-x)/2+con[here+1],now+(long long) (1<<here));
}
if(c>=2*x)
{
all.insert(now+2*(long long) (1<<here));
F(here+1,(c-2*x)/2+con[here+1],now+2*(long long) (1<<here));
}
F(here+1,c/2+con[here+1],now);
}
long long count_tastiness(long long x,vector<long long> a)
{
all.clear();
long long ans=1,t=0,i,now,tt=0;
N=a.size();
::x=x;
for(i=0;i<N;i++) con[i]=a[i];
for(i=0;i<100;i++) have[i].clear();
all.insert(0);
F(0,con[0],0);
return (long long) all.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... | ||||
