# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
421337 | dxz05 | Counting Mushrooms (IOI20_mushrooms) | C++14 | 1 ms | 200 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 ans = 1;
for (int i = 1; i < n; i += 2){
vector<int> v = {0, i, i + 1};
if (v.back() == n) v.pop_back();
int x = use_machine(v);
if (v.size() == 2){
if (x == 0) ans++;
} else {
if (x == 0) ans += 2;
if (x == 2) ans++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |