Submission #1292746

#TimeUsernameProblemLanguageResultExecution timeMemory
1292746kahoulCounting Mushrooms (IOI20_mushrooms)C++20
25 / 100
41 ms388 KiB
#include "mushrooms.h"
using namespace std;

int count_mushrooms(int n) {
	int resp = 1;

	for (int i = 1; i + 1 < n; i += 2) {
		vector<int> m = {i, 0, i + 1};
		resp += 2 - use_machine(m);
	}

	if (n % 2 == 0) {
		vector<int> m = { n -1, 0};
		resp += 1 - use_machine(m);
	}

	return resp;
}
#Verdict Execution timeMemoryGrader output
Fetching results...