Submission #1201456

#TimeUsernameProblemLanguageResultExecution timeMemory
1201456tkm_algorithmsCounting Mushrooms (IOI20_mushrooms)C++20
0 / 100
0 ms320 KiB
/** * 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 = 1, onki = 1; // 1 type A for (int i = 1; i < n; ++i) { m = {i-1, i}; int c = use_machine(m); if (c == 0) { onki = 1-onki; if (onki == 1)res += 1; } else{ if (onki == 1)res += 1; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...