제출 #413127

#제출 시각아이디문제언어결과실행 시간메모리
413127atoiz비스킷 담기 (IOI20_biscuits)C++14
0 / 100
203 ms332 KiB
#include "biscuits.h"
#include <numeric>
#include <cstdio>

long long count_tastiness(long long x, std::vector<long long> a) {
	long long res = 0;
	for (long long i = 0; i <= 100000; ++i) {
		long long c = 0, b = 1, p = i;
		for (long long j = 0; j < (long long) a.size(); ++j) {
			c += a[j];
			if ((p >> j) & 1) {
				p ^= 1ll << j;
				c -= x;
				if (c < 0) b = 0;
			}
			c /= 2;
		}
		if (p) b = 0;
		res += b;
	}
	return res;
}

#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...