# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1185726 | islam_2010 | Counting Mushrooms (IOI20_mushrooms) | C++20 | 0 ms | 420 KiB |
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
int count_mushrooms(int n) {
int ans = 1;
int i = 1;
while (i + 1 < n) {
int a = use_machine({0, i, i + 1});
if (a == 0) {
ans += 2;
} else if (a == 1) {
int b = use_machine({0, i});
if (b == 0) {
ans += 1;
}
} else {
ans += 0;
}
i += 2;
}
if (i < n) {
int c = use_machine({0, i});
if (c == 0) {
ans += 1;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |