# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72354 | 우리는 진실을 잊고 살잖아~~~ (#118) | Magic Dowsing (FXCUP3_magic) | C++17 | 2 ms | 256 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"
//#include <iostream>
//using namespace std;
bool B[101][101];
void FindTreasure(int N) {
int x, y, cnt=0;
for (int i=1; i<=N; i++){
if (Detect(i, i)){
++cnt;
if (cnt == 2){
y=i;
break;
}
x=i;
continue;
}
}
if (cnt > 0){
int c;
if (y != x+1) c = x+1;
else{
if (y != N) c = N;
else c = N-1;
}
if (Detect(x, c)){
Report(x, y);
return;
}
Report(y, x);
return;
}
cnt=0;
for (int i=1; i<=49; i++){
if (Detect(i, 100-i+1)){
++cnt;
x = i;
y = 100-i+1;
break;
}
}
if (cnt == 0) x = 50, y = 51;
int c;
if (y != x+1) c = x+1;
else{
if (y != N) c = N;
else c = N-1;
}
if (Detect(x, c)) Report(x, x);
else Report(y, y);
return;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |