# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
515585 | kostia244 | Minerals (JOI19_minerals) | C++17 | 13 ms | 2192 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 "minerals.h"
#include<bits/stdc++.h>
#define all(x) begin(x), end(x)
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bitset<90000> on;
int qcnt = 0;
int uwusgi(int x) {
on.flip(x);
qcnt++;
return Query(x);
}
#define Query uwusgi
void _Solve(int N, vector<int> AA, vector<int> B, int pop, int fi) {
vector<int> v(1<<pop), V(1<<pop);
iota(all(v), 0);
for(int i = 0; i < 1<<pop; i++) {
V[i] = fi^(i&1);
for(int b = 1; b < pop; b++) {
V[i] += (i>>b)%2 != (i>>(b-1))%2;
}
}
// shuffle(all(v), rng);
stable_sort(all(v), [&](auto x, auto y) {
return V[x] < V[y];
});
vector<int> A(1<<pop, -1), C(1<<pop);
for(int i = 0; i < N; i++)
A[v[i]] = AA[i];
for(int b = 0; b < pop; b++) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |