# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305790 | 2020-09-24T01:21:57 Z | myungwoo | Counting Mushrooms (IOI20_mushrooms) | C++17 | 1 ms | 256 KB |
#include <bits/stdc++.h> #include "mushrooms.h" using namespace std; int count_mushrooms(int n) { vector <int> arr[2]; arr[0] = {0}; for (int i=1;i<n;i++){ if (i+1 < n && arr[0].size() > 1){ int res = use_machine({arr[0][0], i, arr[0][1], i+1}); arr[(res&2)>>1^1].push_back(i); arr[res&1^1].push_back(i); }else if (i+1 < n && arr[1].size() > 1){ int res = use_machine({arr[1][0], i, arr[1][1], i+1}); arr[(res&2)>>1].push_back(i); arr[res&1].push_back(i); } else arr[use_machine({0, i})].push_back(i); } return arr[0].size(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Incorrect | 1 ms | 256 KB | Answer is not correct. |
4 | Halted | 0 ms | 0 KB | - |