Submission #1297496

#TimeUsernameProblemLanguageResultExecution timeMemory
1297496kawhietCounting Mushrooms (IOI20_mushrooms)C++20
10 / 100
62 ms568 KiB
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;

int count_mushrooms(int n) {
	int res = 1, prv = 0;
	vector<int> a = {0};
	vector<int> x;
	for (int i = 1; i < n; i++) {
		x.push_back(i);
	}
	while (!x.empty()) {
		int m = min(x.size(), a.size());
		vector<int> b;
		for (int i = 0; i < m; i++) {
			b.push_back(a[i]);
			b.push_back(x.back());
			x.pop_back();
		}
		int k = use_machine(b);
		res += m - (k + 1) / 2;
	}
	return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...