Submission #346217

#TimeUsernameProblemLanguageResultExecution timeMemory
346217SecretKCounting Mushrooms (IOI20_mushrooms)C++14
Compilation error
0 ms0 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; i++){
		if(use_machine(i,i+1) == 1){
			if(a) a = 0;
			else a = 1;
		}
		if(!a) ans++;
	}
	return ans;
}

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:8:18: error: could not convert 'i' from 'int' to 'std::vector<int>'
    8 |   if(use_machine(i,i+1) == 1){
      |                  ^
      |                  |
      |                  int