#include "mushrooms.h"
#include <vector>
using namespace std;
int count_mushrooms(int n)
{
int ans=0,t;
vector<int> m;
vector<int> fin;
for (int i=1; i<n;i+=2)
{
m.clear();
m.push_back(0);
m.push_back(i);
if(i+1==n) ans+=use_machine(m);
else
{
m.push_back(i+1);
t=use_machine(m);
if(t==2) ans++;
else if(t==1)
{
fin.push_back(i);
fin.push_back(i+1);
}
}
}
ans+=(use_machine(fin)+1)/2;
return ans+1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
0 ms |
256 KB |
Too small array for query. |
3 |
Halted |
0 ms |
0 KB |
- |