# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
581787 | joelau | Counting Mushrooms (IOI20_mushrooms) | C++14 | 124 ms | 300 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;
vector<int> v = {0,0,0};
for (int i = 1; i+1 < n; i += 2) {
v[0] = i, v[2] = i+1;
int x = use_machine(v);
ans += 2-x;
}
if (n % 2 == 0) {
v = {0,n-1};
int x = use_machine(v);
ans += 1-x;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |