Submission #835281

# Submission time Handle Problem Language Result Execution time Memory
835281 2023-08-23T11:38:58 Z welleyth Packing Biscuits (IOI20_biscuits) C++17
0 / 100
1 ms 340 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;

long long count_tastiness(long long x, std::vector<long long> a) {
	int k = 70;
	int b[k+1];
	for(int i = 0; i < a.size(); i++) b[i] = a[i];
	for(int i = a.size(); i < k; i++) b[i] = 0;
	int ans = 0;
	for(int i = 0; i < k; i++){
		b[i+1] += b[i]/2;
		b[i] %= 2;
		ans += b[i];
	}
	return (1ll << ans);
}

Compilation message

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:8:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for(int i = 0; i < a.size(); i++) b[i] = a[i];
      |                 ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 232 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 232 KB Output isn't correct
2 Halted 0 ms 0 KB -