# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1185720 | islam_2010 | Counting Mushrooms (IOI20_mushrooms) | C++20 | 50 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 <= n){
if(i>=n){
break;
}
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++;
}
}else {
ans++;
}
}return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |