Submission #432667

# Submission time Handle Problem Language Result Execution time Memory
432667 2021-06-18T12:15:33 Z Rouge_Hugo Packing Biscuits (IOI20_biscuits) C++14
0 / 100
1000 ms 332 KB
#include<bits/stdc++.h>
#include "biscuits.h"
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
int n;int a[70];int m;
int go(int x)
{int r=0;
    for(int j=0; j<=14; j++)
    {
        int z=0;
        if(((1<<j)&x))z=1;
        r+=a[j];
        if(z)
        {
            if(r<m)
                return 0;
            r-=m;
        }
        r/=2;
    }
    return 1;
}
long long count_tastiness(long long x,vector<long long> A)
{
    m=x;
    memset(a,0,sizeof a);
    n=A.size();
    int re=0;
    for(int i=0; i<n; i++)
        a[i]=A[i];
    for(int i=1; i<=100000; i++)
    {
        re+=go(i);
    }
    re++;
    return re;
}
/*
1
3 3
5 2 1
*/
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 292 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 288 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1093 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 292 KB Output isn't correct
2 Halted 0 ms 0 KB -