# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
304017 | 2020-09-21T00:35:38 Z | Fdg | Counting Mushrooms (IOI20_mushrooms) | C++14 | 0 ms | 0 KB |
#include <iostream> #include <vector> #include <map> #include <set> #include <algorithm> using namespace std; int count_mushrooms(int n) { int ans = 1; for (int i = 1; i < n; i += 2) { vector<int> v; if (i + 1 < n) v = {i, 0, i + 1}; else v = {i, 0}; int ret = use_machine(v); ans += (v.size() - 1) - ret; } return ans; }