# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754198 | nicksms | Cave (IOI13_cave) | C++17 | 1291 ms | 460 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 "cave.h"
#include <bits/stdc++.h>
int ans[5000], w[5000], q[5000];
void exploreCave(int N) {
for (int i = 0; i < N; i++) {
memset(q,0,5000);
for (int j = 0; j < i; j++) q[ans[j]]=w[j];
w[i]=(tryCombination(q)==i);
for (int b = 1; b < N; b<<=1) {
memset(q,0,5000);
for (int k = 0; k < N; k++) {
q[k]=1 ^ w[i] ^ __builtin_popcount(k & b);
}
for (int j = 0; j < i; j++) q[ans[j]]=w[j];
if (tryCombination(q)==i) ans[i] |= b;
}
}
answer(ans,w);
}
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... |