#include <iostream>
#include <vector>
#include "mushrooms.h"
using namespace std;
int count_mushrooms(int n){
int A = 1;
vector<int> vec;
for (int i=1;i<n;){
if (i + 1 < n and n > 4){
vec = {i, 0, i+1, 0};
int ans = use_machine(vec);
if (ans == 0)
A += 2;
else if (ans != 3)
A++;
i += 2;
}
else{
vec = {i, 0};
A += use_machine(vec) == 0;
i++;
}
}
return A;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Incorrect |
0 ms |
344 KB |
Duplicate value 0 in the query array. |
4 |
Halted |
0 ms |
0 KB |
- |