Submission #390359

#TimeUsernameProblemLanguageResultExecution timeMemory
390359MilosMilutinovicCounting Mushrooms (IOI20_mushrooms)C++14
25 / 100
147 ms324 KiB
/** * author: milos * created: 16.04.2021 00:04:13 **/ #include <bits/stdc++.h> #include "mushrooms.h" using namespace std; int count_mushrooms(int n) { int ans = 1; for (int i = 1; i < n; i += 2) { if (i == n - 1) { vector<int> qs = {0, i}; ans += 1 - use_machine(qs); } else { vector<int> qs = {i, 0, i + 1}; int foo = use_machine(qs); ans += 2 - foo; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...