# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
588335 | supercatex | Counting Mushrooms (IOI20_mushrooms) | C++14 | 0 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;
void check_1(int x1, vector<int> &a, vector<int> &b)
{
int x = use_machine(vector<int>{0, x1});
if (x == 0) {
a.push_back(x1);
} else {
b.push_back(x1);
}
}
void check_2(int x1, int x2, vector<int> &a, vector<int> &b)
{
int x = use_machine(vector<int>{x1, 0, x2});
if (x == 0) {
a.push_back(x1);
a.push_back(x2);
} else if (x == 2) {
b.push_back(x1);
b.push_back(x2);
} else {
x = use_machine(vector<int>{0, x1});
if (x == 0) {
a.push_back(x1);
b.push_back(x2);
} else {
a.push_back(x2);
b.push_back(x1);
}
}
}
void check_3(int x1, int x2, int x3, vector<int> &a, vector<int> &b)
{
}
int count_mushrooms(int n)
{
vector<int> a, b;
a.push_back(0);
for (int i = 1; i < n; i++) {
if (i + 1 < n)
check_2(i, i + 1, a, b);
else
check_1(i, a, b);
}
return a.size();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |