# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72344 | 2018-08-26T07:20:33 Z | Semteo For Ajou(#2257, tph00300, txepahs, bmw) | Magic Dowsing (FXCUP3_magic) | C++17 | 2 ms | 252 KB |
#include "dowsing.h" void FindTreasure(int N) { int i, j; int m = 0, arr[3] = { 0 }; for (i = 1; i <= N; i++) { if (Detect(i, i) == 1) { m++; arr[m] = i; } } if (m == 2) { if (Detect(arr[1], arr[2]) == 0) Report(arr[1], arr[2]); else Report(arr[2], arr[1]); } else if (m == 0) { int flag = 0; for (i = 1; i <= N; i++) { if (Detect(i, 1) == 1) { flag = i; break; } } if (flag == 0) Report(1, 1); else Report(flag, flag); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 252 KB | Execution failed because the return code was nonzero |
2 | Halted | 0 ms | 0 KB | - |