Submission #347806

#TimeUsernameProblemLanguageResultExecution timeMemory
347806ponkungCounting Mushrooms (IOI20_mushrooms)C++14
0 / 100
0 ms364 KiB
#include "mushrooms.h" int count_mushrooms(int n) { /*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 c1+c2;*/ std::vector<int> v; int it=1,cnt=1,op; for(int i=1;i<n;i++) { v.push_back(i-1); v.push_back(i); op=use_machine(v); v.clear(); if(op==2) { it=1-it; } if(it==1) { ++cnt; } } return cnt; }
#Verdict Execution timeMemoryGrader output
Fetching results...