Submission #346055

#TimeUsernameProblemLanguageResultExecution timeMemory
346055athensclubCounting Mushrooms (IOI20_mushrooms)C++14
0 / 100
0 ms364 KiB
#include "mushrooms.h" #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); }
#Verdict Execution timeMemoryGrader output
Fetching results...