| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 71977 | 마릴린 희정 (#118) | Magic Dowsing (FXCUP3_magic) | C++17 | 3 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dowsing.h"
#include<vector>
using namespace std;
void FindTreasure(int N) {
int rem = 0;
vector<int> hubo;
for(int i=1; i<=N; ++i)
{
if(Detect(i, i))
hubo.push_back(i);
else
rem = i;
}
if(hubo.empty())
{
rem = N;
for(int i=0; i<(N-1)/2; ++i)
{
if(Detect(2*i+1, 2*i+2))
{
if(Detect(rem, 2*i+1))
Report(2*i+1, 2*i+1);
else
Report(2*i+2, 2*i+2);
return;
}
}
if(N%2==1) Report(N, N);
else
{
rem = 1;
if(Detect(rem, N)) Report(N, N);
else Report(N-1, N-1);
}
return;
}
else
{
int v1, v2;
int r = hubo[0], c = hubo[1];
if(Detect(r, rem)) v1 = r; else v1 = c;
if(Detect(rem, r)) v2 = r; else v2 = c;
Report(v1, v2);
return;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
