Submission #346220

#TimeUsernameProblemLanguageResultExecution timeMemory
346220SecretKCounting Mushrooms (IOI20_mushrooms)C++14
10 / 100
253 ms384 KiB
#include "mushrooms.h"
 
int count_mushrooms(int n) {
	std::vector<int> m;
	bool a = 0;
	int ans = 1;
	for (int i = 0; i < n-1; i++){
		if(use_machine({i,i+1}) == 1){
			if(a) a = 0;
			else a = 1;
		}
		if(!a) ans++;
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...