Submission #421822

#TimeUsernameProblemLanguageResultExecution timeMemory
421822Mohammed_AtalahCounting Mushrooms (IOI20_mushrooms)C++17
10 / 100
264 ms552 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;


int count_mushrooms(int n) {

	vector<int> indices;
	for (int i = 0; i < n; i++) {
		indices.push_back(i);
	}


	if (use_machine(indices) == 0) {
		return n;
	}


	int bs = 0;
	for (int i = 1; i < n; i++) {
		std::vector<int> v;
		v.push_back(0);
		v.push_back(i);
		if (use_machine(v) == 1) {
			bs++;
		}
	}
	return n - bs;

}
#Verdict Execution timeMemoryGrader output
Fetching results...