Submission #860486

# Submission time Handle Problem Language Result Execution time Memory
860486 2023-10-13T06:43:10 Z mychecksedad Packing Biscuits (IOI20_biscuits) C++17
0 / 100
1 ms 348 KB
#include<biscuits.h>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD (1000000000+7)
#define MOD1 (998244353)
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n'
const int N = 1e6+100, M = 1e5+10, K = 22;

ll count_tastiness(ll x, vector<ll> a){
	int n = a.size();
	vector<ll> p;
	p.pb(0);
	ll ans = 1;
	for(int i = 0; i < n; ++i){
		ans += int(p.size()) - (lower_bound(all(p), x - a[i]) - p.begin());
		vector<ll> np;
		for(auto y: p){
			np.pb((y+a[i])>>1);
			if(y+a[i]-x >= 0) np.pb((y+a[i]-x)>>1);
		}
		sort(all(np));
		p = np;
		// for(auto f: p) cout << f << ' ';
		// en;
	// cout << ans << '\n';
	}
	return ans;
}

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -