| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 72870 | ainta | 마법 다우징 (FXCUP3_magic) | C++17 | 3 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... | ||||
