# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
390864 | AlexPop28 | Counting Mushrooms (IOI20_mushrooms) | C++14 | 2 ms | 200 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 "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEFINE
const int K = 2;
#else
const int K = 141;
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int count_mushrooms(int n) {
if (n <= K) {
int ans = 0;
for (int i = 1; i < n; ++i) {
vector<int> curr = {0, i};
ans += use_machine(curr);
}
return n - ans;
}
vector<int> val(n, -1);
val[0] = 0;
auto Get = [&]() {
int pos = rng() % n;
while (val[pos] >= 0) pos = rng() % n;
return pos;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |