# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72095 | 유애나 (#118) | Magic Dowsing (FXCUP3_magic) | C++17 | 3 ms | 376 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 <vector>
using namespace std;
void FindTreasure(int N) {
vector<int> v;
for(int i = 1; i <= N; i++){
if(Detect(i, i)) v.push_back(i);
}
if(v.empty()){
for(int i = 2; i <= N; i += 2){
if(Detect(i - 1, i)){
if(Detect(i - 1, (i == 2 ? N : 1))) Report(i - 1, i - 1);
else Report(i, i);
return;
}
}
Report(N, N);
}
else{
if(Detect(v[0], (v[0] == 1 ? (v[1] == N ? 2 : N) : 1))) Report(v[0], v[1]);
else Report(v[1], v[0]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |