Submission #405799

# Submission time Handle Problem Language Result Execution time Memory
405799 2021-05-16T22:48:59 Z ly20 Packing Biscuits (IOI20_biscuits) C++17
0 / 100
1000 ms 332 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 40, INF = 1e9;

long long mc[MAXN];

long long count_tastiness(long long x, vector<long long> a) {
	long long resp = 0;
	for(int j  = 0; j <= 100000; j++) {
        for(int i = 0; i < a.size(); i++) {
            mc[i] = a[i];
        }
        bool ok = true;
        for(int i = 0; i < 32; i++) {
            if((1 << i) & j) {
                if(mc[i] < x) {
                    ok = false;
                    break;
                }
                mc[i] -= x;
            }
            mc[i + 1] += mc[i] / 2;
        }
        if(ok) resp++;
	}
	return resp;
}

Compilation message

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:12:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |         for(int i = 0; i < a.size(); i++) {
      |                        ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 268 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1098 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -