Submission #313931

#TimeUsernameProblemLanguageResultExecution timeMemory
313931srvltCounting Mushrooms (IOI20_mushrooms)C++14
10 / 100
195 ms512 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define SZ(x) (int)(x).size() #define all(x) begin(x), end(x) int count_mushrooms(int n) { vector<int> m, c(n); int res = 1; for (int i = 1; i < n; i++) { m.clear(); m.pb(i - 1), m.pb(i); if (use_machine(m)) c[i] = c[i - 1] ^ 1; else c[i] = c[i - 1]; res += (c[i] == 0); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...