Submission #403393

# Submission time Handle Problem Language Result Execution time Memory
403393 2021-05-13T06:41:01 Z AmineTrabelsi Packing Biscuits (IOI20_biscuits) C++14
0 / 100
1000 ms 332 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
vector<long long> powr;
long long count_tastiness(long long x,vector<long long> a) {
    long long curr = 1;
    for(int i=0;i<=20;i++){
        powr.push_back(curr);
        curr*=2;
    }
    reverse(a.begin(),a.end());
    int res = 1;
    for(int y=1;y<=100000;y++){
        //if(y >= 6)break;
        //cerr<<y<<": \n";
        curr = y;
        int pwr = a.size() -1;
        for(auto i:a){
            //cerr<<curr<<" "<<i<<" "<<pwr<<'\n';
            int cnt = i;
            while(cnt && curr >= powr[pwr]){
                curr-=powr[pwr];
                cnt--;
            }
            pwr--;
        }
        if(curr == 0)res++;
        //cerr<<curr<<endl;
    }
	return res;
}

// run biscuits 03.in 03.out
# Verdict Execution time Memory Grader output
1 Execution timed out 1074 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1076 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1099 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1074 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -