Submission #1052115

# Submission time Handle Problem Language Result Execution time Memory
1052115 2024-08-10T11:54:06 Z fuad27 Counting Mushrooms (IOI20_mushrooms) C++17
Compilation error
0 ms 0 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
map<pair<int, long long>, long long> mp;
long long X;
vector<long long> A;
int k;
long long solve(int i, long long add) {
	if(i == k)return 1;
	if(add + A[i] < X) {
		add=0;
	}
	if(mp.find({i, add}) != mp.end())return mp[{i, add}];
	mp[{i, add}] += solve(i+1, (add+A[i])/2);
	if(add+A[i] >= X) {
		mp[{i, add}] += solve(i+1, (add+A[i]-X)/2);
	}
	return mp[{i, add}];
}
long long count_tastiness(long long x, std::vector<long long> a) {
	mp.clear();
	X=x;
	A=a;
	k = 60;
	A.resize(61);
	for(int i = 0;i<k;i++) {
		if(A[i] > x) {
			long long c = A[i]-x;
			A[i+1] += c/2;
			c/=2;
			c*=2;
			A[i] -= c;
		}
	}
	return solve(0, 0);
}
 

Compilation message

mushrooms.cpp:1:10: fatal error: biscuits.h: No such file or directory
    1 | #include "biscuits.h"
      |          ^~~~~~~~~~~~
compilation terminated.