Submission #829152

# Submission time Handle Problem Language Result Execution time Memory
829152 2023-08-18T05:33:44 Z definitelynotmee Packing Biscuits (IOI20_biscuits) C++17
Compilation error
0 ms 0 KB
#include "biscuits.h"
#include"grader.cpp"
#include<bits/stdc++.h>
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
const ll INFL = 2e18;
using pll = pair<ll,ll>;


long long count_tastiness(long long x, std::vector<long long> a) {
	a.resize(60,0);

	int k = a.size();

	vector<ll> ct(k);

	ct[0] = a[0];

	for(int i = 1; i < k; i++){
		ct[i] = a[i]*(1ll<<i)+ct[i-1];
	}

	vector<ll> poss = {0};
	poss.reserve(2e5);

	for(int i = 0; i < k; i++){
		if((1ll<<i)*x >= INFL)
			break;
		int n = poss.size();

		for(int j = 0; j < n; j++){
			if(ct[i]-poss[j]*x >= (1ll<<i)*x)
				poss.push_back((1ll<<i)+poss[j]);
		}
	}

	return poss.size();
	
}

Compilation message

/usr/bin/ld: /tmp/cc0vhr9Z.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccQWZNg0.o:biscuits.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status