# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720668 | jairRS | Counting Mushrooms (IOI20_mushrooms) | C++17 | 87 ms | 220 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)
{
int count = 1;
// X A X - good
// A X A X A X
if (n <= 5)
{
for (int i = 1; i < n; i++)
count += 1 - use_machine({0, i});
return count;
}
vector<int> As = {0};
vector<int> Bs = {};
for (int i = 1; i <= 5; i++)
{
int query = use_machine({0, i});
if (query)
Bs.push_back(i);
else
As.push_back(i);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |