Submission #834613

# Submission time Handle Problem Language Result Execution time Memory
834613 2023-08-22T15:59:14 Z Johann 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;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

ll X;

long long count_tastiness(long long _X, std::vector<long long> a)
{
	for (int i = 0; i < sz(a); ++i)
	{
		if (a[i] >= 3)
		{
			if (i + 1 < sz(a))
				a.push_back(0);
			if (a[i] & 1)
				a[i + 1] += a[i] / 2, a[i] = 1;
			else if (a[i] > 0)
				a[i + 1] += a[i] / 2 - 1, a[i] = 2;
		}
	}
	a.push_back(0);
	ll ans = 1;
	ll base = 1;
	ll tmp = 1;
	for (int i = 0; i < sz(a); ++i)
	{
		if (a[i] == 0)
		{
			ans *= tmp;
			tmp = 1;
			base = 1;
		}
		else
		{
			tmp += base * a[i];
			base *= 2;
		}
	}

	return ans;
}
# 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 212 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 212 KB Output isn't correct
2 Halted 0 ms 0 KB -