Submission #1359546

#TimeUsernameProblemLanguageResultExecution timeMemory
1359546FZ_LaabidiCounting Mushrooms (IOI20_mushrooms)C++20
Compilation error
0 ms0 KiB
int count_mushrooms(int n) {

		int o = 1;
		for(int i=1; i<n-1; i+=2){
			o+=2;
			o-=use_machine({i, 0, i+1});
		}
		if(n%2==0)o+=(1-use_machine({0, n-1}))
		return o;

}

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:6:28: error: 'use_machine' was not declared in this scope
    6 |                         o-=use_machine({i, 0, i+1});
      |                            ^~~~~~~~~~~
mushrooms.cpp:8:33: error: 'use_machine' was not declared in this scope
    8 |                 if(n%2==0)o+=(1-use_machine({0, n-1}))
      |                                 ^~~~~~~~~~~
mushrooms.cpp:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
   11 | }
      | ^