이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#include "island.h"
typedef long long ll;
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(int N, int L) {
vector <int> order;
for(int i = 1; i < N; i++)order.push_back(query(1, i));
set <int> s;
set <int> ss;
ss.insert(1);
s.insert(1);
for(int i = 0; i < (int)order.size(); i++){
int cnt = 1;
if(ss.find(order[i]) != ss.end()){
s.insert(order[i]);
continue;
}
while(1){
int res = query(order[i], cnt);
cnt++;
answer(res, order[i]);
ss.insert(res);
if(s.find(res) != s.end()){
break;
}
}
s.insert(order[i]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |