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 <bits/stdc++.h>
using namespace std;
void solve(int N, int L) {
bool done[400];
for(int i = 0; i <= N; i++){
done[i] = false;
}
vector<int> v;
int inv[400];
inv[1] = -1;
for(int i = 1; i < N; i++){
v.push_back(query(1,i));
inv[v[i - 1]] = i - 1;
}
for(int i = 0; i < N - 1; i++){
if(done[i]) continue;
int cont = 1;
while(true){
int num = query(v[i],cont);
if(inv[num] < i){
answer(num,v[i]);
break;
}
else{
answer(num,v[i]);
done[inv[num]] = true;
}
cont++;
}
}
}
# | 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... |