#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);
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==1)ans++;
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Answer is not correct. |
2 |
Halted |
0 ms |
0 KB |
- |