# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
71961 | 이시대의진정한망겜스타투 (#118) | 마법 다우징 (FXCUP3_magic) | C++17 | 3 ms | 424 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 "dowsing.h"
void FindTreasure(int N) {
int i, j, c1 = -1, c2 = -1, c3 = -1;
for (i = 1; i <= N; i++) {
if (Detect(i, i)) {
if (c1 == -1)c1 = i;
else c2 = i;
}
else {
c3 = i;
}
}
if (c1 != -1) {
if (Detect(c1, c3)) {
Report(c1, c2);
}
else Report(c2, c1);
return;
}
for (i = 1; i < N - 1; i += 2) {
if (Detect(i, i + 1)) {
for (j = 1; j <= N; j++) {
if (i != j &&i + 1 != j) {
if (Detect(i, j)) {
Report(i, i);
}
else {
Report(i + 1, i + 1);
}
return;
}
}
}
}
if (N % 2 == 1) {
Report(N, N);
}
else {
if (Detect(1, N))Report(N, N);
else Report(N - 1, N - 1);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |