Submission #305381

# Submission time Handle Problem Language Result Execution time Memory
305381 2020-09-23T02:06:31 Z daniel920712 Packing Biscuits (IOI20_biscuits) C++14
0 / 100
2 ms 384 KB
#include "biscuits.h"
using namespace std;
long long con[105]={0};
long long count_tastiness(long long x,vector<long long> a)
{
    long long ans=1,t=0,N=a.size(),i;
    for(i=0;i<N||con[i];i++)
    {
        con[i]=a[i];
        if(con[i]>2)
        {
            if(con[i]%2==0)
            {
                con[i+1]=con[i]/2-1;
                con[i]=2;
            }
            else
            {
                con[i+1]=con[i]/2;
                con[i]=1;
            }
        }
    }
    N=i;
    t=0;
    for(i=0;i<N;i++)
    {
        if(con[i]==0)
        {
            ans=ans*(t+1);
            t=0;
        }
        else
        {
            t*=2;
            t+=con[i];
        }
    }
    ans=ans*(t+1);
	return ans;
}

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -