# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
588927 | LIF | Counting Mushrooms (IOI20_mushrooms) | C++14 | 117 ms | 288 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"
#include<bits/stdc++.h>
using namespace std;
int count_mushrooms(int n) {
std::vector <int> m;
int aans = 1;
for(int i=2;i<n;i+=2)
{
m.push_back(i);
m.push_back(0);
m.push_back(i-1);
int ans = use_machine(m);
aans += (2-ans);
m.clear();
}
if(n%2==0)
{
m.push_back(0);
m.push_back(n-1);
int ans = use_machine(m);
if(ans == 0)aans++;
}
return aans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |