Submission #405787

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

const int MAXN = 40, INF = 1e9;

int 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 j = 0; j < MAXN; j++) {
            if(mc[j] < x) {
                ok = false;
                break;
            }
            mc[j] -= x;
            mc[j + 1] += mc[j] / 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 12 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 653 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -