#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
int count_mushrooms( int n ){
int resp = 1, last = -1;
for( int i = 1; i < n; i ++ ){
// if( i == n - 1 ){
vi a = { 0, i };
if( use_machine(a) == 0 ) resp++;
// }
// else if( last == -1 ){
// vi a = { 0, i, i + 1 };
// int x = use_machine(a);
// if( x == 0 ) resp += 2;
// else if( x == 2 ) resp++;
// else last = i;
// }
// else{
// vi a = { last, last + 1, i, i + 1 };
// int x = use_machine(a);
// if( x == 3 ) resp += 2;
// else if( x == 1 || x == 2 ) resp++;
// last = -1;
// }
}
// if( last != -1 ){
// vi a = {0, last};
// if( use_machine(a) == 0 ) resp++;
// }
return resp;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |