제출 #400007

#제출 시각아이디문제언어결과실행 시간메모리
400007faresbasbs비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1126 ms788448 KiB
#include <bits/stdc++.h>
#include "biscuits.h"
using namespace std;
vector<long long> a,dp,dp2;
long long x;

long long count_tastiness(long long X , vector<long long> A){
	a = A , x = X;
	while(a.size() < 60){
		a.push_back(0ll);
	}
	dp = {0};
	for(int i = 0 ; i < 60 ; i += 1){
		dp2.clear();
		for(auto j : dp){
			j += a[i];
			dp2.push_back(j/2);
			if(j >= x){
				dp2.push_back((j-x)/2);
			}
		}
		swap(dp,dp2);
	}
	return dp.size();
}
#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...