# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1185689 | islam_2010 | 버섯 세기 (IOI20_mushrooms) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
int count_mushrooms(int n){
int l = 1, r = n-2;
int x = use_machine({0, n-1});
int ans = 0;
while (l < r){
int a = use_machine({0, l});
int b = used_machine({l, r});
if(a==0){
if(b==0){
ans+=2;
}if(b==1){
ans+=+;
}
}else {
if(b==1){
ans++;
}
}
}if(x==1){
ans++;
}else {
ans+=2;
}return ans;
}