# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72224 | 비타500 (#118) | 마법 다우징 (FXCUP3_magic) | C++17 | 3 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <algorithm>
#include "dowsing.h"
void FindTreasure(int N) {
bool firstCheck = false;
int ff = 0, ss = 0;
bool f[101];
for (int i = 1; i <=100; i++) {
f[i] = false;
}
for (int i = 1; i <= N; i++) {
if (Detect(i, i)) {
if (!firstCheck) {
ff = i;
firstCheck = true;
}
else {
ss = i;
break;
}
}
}
if (firstCheck == false) {
for (int i = 1; i <= (N - 1) / 2; i++) {
if (Detect(i, N - i + 1)) {
int alpha = 1;
if (alpha + i == N - i + 1) {
alpha += 1;
}
if (Detect(i, i + alpha)) {
Report(i, i);
return;
}
else {
Report(N - i + 1, N - i + 1);
return;
}
}
else {
}
}
Report((N + 1) / 2, (N + 1) / 2);
return;
}
if (ff > ss) {
std::swap(ff, ss);
}
// ff < ss
int alpha = 1 + (ff + 1 == ss);
if (ff + alpha > N) {
alpha = -1;
}
if (Detect(ff + alpha, ss)){
Report(ff, ss);
}
else {
Report(ss, ff);
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |