# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
588925 | LIF | Counting Mushrooms (IOI20_mushrooms) | C++14 | 104 ms | 208 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;
int pointer = 1;
bool check[200005];
for(int i=0;i<n;i++)
{
check[i] = false;
}
check[0] = true;
for(int i=2;i<n;i+=2)
{
if(i+1<n)
{
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;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |