제출 #1054577

#제출 시각아이디문제언어결과실행 시간메모리
1054577Gromp15비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h>
#include "biscuits.h"
#define ll long long
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;

long long count_tastiness(long long x, std::vector<long long> a) {
	map<ll, ll> dp;
	dp[0] = 1;
	for (int i = 0; i < sz(a); i++) {
		map<ll, ll> dp2;
		for (auto [j, val] : dp) {
			if (j + a[i] >= x) dp2[(j + a[i] - x) >> 1] += val;
			dp2[(j + a[i]) >> 1] += val;
		}
		swap(dp, dp2);
	}
	ll ans = 0;
	for (auto [z, y] : dp) ans += y;
	return ans;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...