# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
424238 | Apiram | 버섯 세기 (IOI20_mushrooms) | C++14 | 1 ms | 200 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 solve (int left,int right){
vector<int>arr;
if (left>right)return 0;
if (left==right){
int a= use_machine({0,left});
if (a==0)return 1;
else return 0;
}
for (int i =left;i<right;++i){
arr.push_back(i);
}
int mid = (left + right)>>1;
int a= use_machine(arr);
if (a==0){
a=use_machine({0,left});
if (a==0){
return right - left +1;
}
else return 0;
}
else return solve(left,mid)+solve(mid,right);
}
int count_mushrooms(int n) {
return solve(1,n);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |