# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
306584 | chubyxdxd | Counting Mushrooms (IOI20_mushrooms) | C++17 | 127 ms | 464 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>
#define pb push_back
using namespace std;
int count_mushrooms(int n){
int ans=1;
vector<int> m;
m.push_back(0);
m.push_back(n-1);
int f=use_machine(m);
if(f==0)ans++;
for(int i=1;i<=n/2-1;i++){
m.clear();
m.pb(i);
m.pb(0);
m.pb(n-i-1);
int f=use_machine(m);
if(f==0)ans+=2;
if(f==1)ans+=1;
}
if(n%2==1){
m.clear();
m.pb(0);
m.pb(n/2);
int f=use_machine(m);
if(f==0)ans++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |