# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
347807 | ponkung | Counting Mushrooms (IOI20_mushrooms) | C++14 | 0 ms | 364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "mushrooms.h"
using namespace std;
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;*/
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |