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 "island.h"
#include <vector>
#include <algorithm>
using namespace std;
void solve(int N, int L){
vector<int> dist(N, 0), near(N, 0), ok(N, 0);
dist[0] = 0;
near[0] = 0;
for(int i = 1; i < N; i++){
int a = query(1, i) - 1;
dist[a] = i;
near[i] = a;
}
for(int t = 1; t < N; t++){
int i = near[t];
if(ok[i]){
continue;
}
for(int j = 1; j < N; j++){
int a = query(i + 1, j) - 1;
if(dist[a] < dist[i]){
answer(i + 1, a + 1);
break;
}
else{
answer(i + 1, a + 1);
ok[a] = 1;
}
}
}
}
# | 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... |