# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420549 | ioi | Counting Mushrooms (IOI20_mushrooms) | C++14 | 132 ms | 320 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 ;
for(int i = 1 ; i + 1 < n ; i += 2){
vector<int> m = {i , 0 , i + 1};
int a = use_machine(m);
if(a == 0)ans += 2 ;
if(a == 1)ans ++ ;
}
if(n % 2 == 0){
if(!use_machine({0 , n - 1}))ans ++ ;
}
return ans ;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |