# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
835686 | BT21tata | Counting Mushrooms (IOI20_mushrooms) | C++17 | 8 ms | 332 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>
#define pb push_back
using namespace std;
const int BLOCK=271;
vector<int>a, b;
int count_mushrooms(int n)
{
a.pb(0);
if(n<=220)
{
for(int i=1; i<n; i++)
{
int cnt=use_machine({0, i});
if(cnt) b.pb(i);
else a.pb(i);
}
return a.size();
}
if(use_machine({0, 1})) b.pb(1);
else a.pb(1);
if(use_machine({0, 2})) b.pb(2);
else a.pb(2);
for(int i=3; i<BLOCK; i+=2)
{
if(a.size()>=2)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |