제출 #400012

#제출 시각아이디문제언어결과실행 시간메모리
400012faresbasbs비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1122 ms1051108 KiB
#include <bits/stdc++.h>
#include "biscuits.h"
using namespace std;

long long count_tastiness(long long x , vector<long long> a){
	while(a.size() < 60){
		a.push_back(0ll);
	}
	long long sum = 0 , val = 1;
	vector<long long> all = {0ll};
	for(int i = 0 ; i < (int)a.size() ; i += 1){
		sum += val*a[i];
		long long y = min(sum/x,2*val-1);
		if(y >= val){
			int f = all.size();
			for(int j = 0 ; j < f ; j += 1){
				if(all[j]+val > y){
					break;
				}
				all.push_back(all[j]+val);
			}
		}
		val *= 2;
	}
	return all.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...