# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
876838 | Kanon | Counting Mushrooms (IOI20_mushrooms) | C++14 | 5 ms | 804 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
int magic = 55;
const int bound = 226;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
// generate random number between l, r : uniform_int_distribution<long long>(l, r)(rng)
// random shuffle : shuffle(.begin(), .end(), rng)
int count_mushrooms(int n) {
if (n <= bound + 1) {
int ret = 1;
for (int i = 1; i < n; i++) {
ret += use_machine({0, i}) ^ 1;
}
return ret;
}
vector<int> a(n, -1);
a[0] = 0;
vector<int> order(2 * magic);
iota(order.begin(), order.end(), 1);
int cnt = 2 * magic + 1;
vector<int> zeros, ones;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |