# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1115686 | Numberz | Counting Mushrooms (IOI20_mushrooms) | C++14 | 0 ms | 0 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>
using namespace std;
#define ll long long
int count_cocaine(int n) {
vector<int> A_count = {0};
vector<int> B_count;
int total = 1;
// Handle small cases directly
if (n <= 90) {
int sum = 1;
for (int i = 1; i < n; i++) {
if (use_machine({0, i}) == 0) sum++;
}
return sum;
}
// Initial partitioning
for (int i = 1; i <= 2; i++) {
if (use_machine({0, i}) == 0) {
A_count.push_back(i);
total++;
} else {
B_count.push_back(i);
}
}
// Efficiently partition the first 88 elements
for (int j = 3; j < 88; j += 2) {