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<bits/stdc++.h>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <random>
#include <utility>
#include <vector>
#include "island.h"
using namespace std;
void solve(int N, int L) {
vector<bool> vis(N + 1);
vector<int> order(N + 1);
for(int i = 1; i < N; ++i){
order[i] = query(1, i);
}
vis[1] = true;
for(int _i = 1; _i < N; ++_i){
int i = order[_i];
if(vis[i]) continue;
int x = i, depth = 1;
vis[i] = true;
while(true){
x = query(i, depth);
if(vis[x]) break;
vis[x] = true;
answer(x, i);
++depth;
}
answer(x, 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... |