Submission #590294

# Submission time Handle Problem Language Result Execution time Memory
590294 2022-07-05T18:44:22 Z Lucpp Packing Biscuits (IOI20_biscuits) C++17
0 / 100
15 ms 400 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
const int k = 60;

ll count_tastiness(ll x, vector<ll> a) {
	a.resize(k);
	vector<ll> dp(k+1, 1);
	ll sum = 0;
	for(int i = 1; i <= k; i++){
		sum += a[i-1]*(1ll<<(i-1));
		ll s = sum;
		ll sub = 0;
		for(int j = i-1; j >= 0; j--){
			if((s-sub)/x >= (1ll<<j)){
				dp[i] += dp[j];
				sub = x*(1ll<<j);
			}
			ll v = a[j]*(1ll<<j);
			sub = max(0ll, sub-v);
			s -= v;
		}
	}
	return dp[k];
}
# 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 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 400 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 -