Submission #696330

# Submission time Handle Problem Language Result Execution time Memory
696330 2023-02-06T08:58:17 Z garam1732 Packing Biscuits (IOI20_biscuits) C++14
0 / 100
1 ms 340 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

long long count_tastiness(long long x, std::vector<long long> a) {
	int T = 60;
	while(T--) {
	for(int i = 0; i < a.size(); i++) {
        for(int j = i+1; j < a.size(); j++) {
            if(a[i] >= (1<<(j-i))-1) {
                a[i] += a[j]*(1<<(j-i));
                a[j] = 0;
            }
        }
	}
	}

	ll res = 1;
	for(ll x : a) res *= (x+1);
	return res;
}

Compilation message

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