# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72313 | https://blog.naver.com/nywoo19 (#118) | 마법 다우징 (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 <bits/stdc++.h>
using namespace std;
void FindTreasure(int N) {
int R, C;
vector<int> vt;
for(int j = 1; j <= N; j++){
if(Detect(j, j)){
vt.push_back(j);
}
}
if(vt.size() == 0){
for(int j = 1; j < (N + 1) / 2; j++){
if(Detect(j, N - j + 1)){
if(Detect(j, j)) Report(N - j + 1, N - j + 1);
else Report(j , j);
return;
}
}
Report((N + 1) / 2, (N + 1) / 2);
}
else{
int R = vt[0], C = vt[1];
bool f = false;
for(int i = 1; i <= 5; i++){
if(i == C) continue;
if(!Detect(R, i)){
f = true;
break;
}
}
if(f) swap(R, C);
Report(R, C);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |