Submission #1082785

#TimeUsernameProblemLanguageResultExecution timeMemory
1082785beaconmc비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1066 ms348 KiB
#include "biscuits.h"
#include <bits/stdc++.h>
 
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
 
using namespace std;

long long count_tastiness(long long x, std::vector<long long> a) {
	vector<ll> temp = a;
	ll ans = 0;



	FOR(req,0,100005/x + 2){

		a = temp;
		bool flag = false;
		FOR(k,0,x){

			ll sus = 0;

			FORNEG(i,a.size()-1, -1){

				while (sus + (1<<i) <= req && a[i]) sus += (1<<i), a[i]--;
			}

			if (sus != req){
				flag = true;
				break;
			}

		}
		if (!flag)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...