| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356954 | velvet_haze | Counting Mushrooms (IOI20_mushrooms) | C++20 | 22 ms | 412 KiB |
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
int count_mushrooms(int n)
{
int cnt=1,x;
vector<int> m;
for (int i = 2; i < n; i+=2)
{
m={i-1,0,i};
x=use_machine(m);
if(x==0)
cnt+=2;
else if(x==1)
cnt++;
}
if(n%2==0)
{
x=use_machine({0,n-1});
if(x==0)
cnt++;
}
return cnt;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
