제출 #1148715

#제출 시각아이디문제언어결과실행 시간메모리
1148715PagodePaivaPacking Biscuits (IOI20_biscuits)C++20
0 / 100
1096 ms320 KiB
#include "biscuits.h"
#include<bits/stdc++.h>

using namespace std;

long long count_tastiness(long long x, std::vector<long long> a) {
	int ans = 1;
	int k = a.size();
	for(int i = 1;i <= 100000/x;i++){
		vector <long long> aux = a;
		bool eba = true;
		for(int xx = 0;xx < x;xx++){
			int bit = (1<<(k-1));
			int y = i;
			for(int j = k-1;j >= 0;j--){
				while(y >= bit){
					if(aux[j] > 0) {
						y -= bit;
						aux[j]--;
					}
					else break;
				}
				bit /= 2;
			}
			if(y > 0) eba = false;
		}
		if(eba) ans++;
	}	
	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...