Submission #346168

#TimeUsernameProblemLanguageResultExecution timeMemory
346168SecretKCounting Mushrooms (IOI20_mushrooms)C++14
10 / 100
209 ms492 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-1; i++){ if(use_machine({i,i+1}) == 1){ if(a) a = 0; else a = 1; } if(!a) ans++; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...