Submission #346054

#TimeUsernameProblemLanguageResultExecution timeMemory
346054athensclubCounting Mushrooms (IOI20_mushrooms)C++14
Compilation error
0 ms0 KiB
#include <vector> int div2RoundUp(int x) { int d = x / 2; if (d * 2 < x) return d + 1; return d; } int count_mushrooms(int n) { std::vector<int> m; for (int i = 0; i < n; i++) m.push_back(i); int c1 = use_machine(m); m = {0, 1}; int c2 = use_machine(m); return c2 == 1 ? div2RoundUp(c1) : n - div2RoundUp(c1); }

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:17:11: error: 'use_machine' was not declared in this scope
   17 |  int c1 = use_machine(m);
      |           ^~~~~~~~~~~