#include "dowsing.h"
void FindTreasure(int N) {
int hasIdx = -1;
for (int i = 1; i <= N; ++i) {
int check = Detect(1, i);
if (check) {
hasIdx = i;
break;
}
}
if (hasIdx == -1)
for (int i = 1; i <= N; ++i) {
int check = Detect(2, i);
if (check) {
hasIdx = i;
break;
}
}
int yIdx = -1;
for (int i = 1; i <= N; ++i) {
int check = Detect(i, hasIdx);
if (check == 0) {
yIdx = i;
break;
}
}
Report(yIdx, hasIdx);
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
256 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |