/**
* In the name of Allah
* We are nothing and you're everything
**/
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
using ll = long long;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
//#define int long long
const char nl = '\n';
int count_mushrooms(int n) {
vector<int> m;
int res = 0, onki = 1; // 1 type A
for (int i = 1; i < n; ++i) {
m = {i-1, i};
int c = use_machine(m);
if (c == 1) {
onki = 1-onki;
if (onki == 1)res += 1;
} else{
if (onki == 1)res += 1;
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |