| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 97362 | ahgus89 | 마법 다우징 (FXCUP3_magic) | C++14 | 3 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dowsing.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
mt19937 rd((unsigned)chrono::steady_clock::now().time_since_epoch().count());
inline int ask(int x, int y)
{
return Detect(x, y);
}
void FindTreasure(int n)
{
int i, j, k=1, arr[101];
bool chk[101];
memset(chk, 0, sizeof(chk));
vector<int> v;
for(i=1;i<=n;i++)
if(ask(i, i)) v.push_back(i);
if(v.size()==2)
{
i=v[0];j=v[1];
if(i==k) k=2;
if(j==k) k=3;
if(ask(k, j))
{
Report(i, j);
return;
}
Report(j, i);
return;
}
for(i=1;i<(n+1)/2;i++)
if(ask(2*i-1, 2*i)) break;
if(2*i-1==k) k=3;
if(ask(k, 2*i-1))
{
Report(2*i-1, 2*i-1);
return;
}
Report(2*i, 2*i);
return;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
