# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1019071 | Nurislam | Island Hopping (JOI24_island) | C++17 | 3 ms | 344 KiB |
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>
#define pb push_back
using namespace std;
vector<int> ord, pos(400), p(400);
void solve(int N, int L){
for(int i = 1; i < N; i++){
ord.pb(query(1, i));
}
for(int i = 0; i < ord.size(); i++){
pos[ord[i]] = i+1;
}
for(int i = 0; i < ord.size(); i++){
if(!p[ord[i]]){
for(int k = 1; k < N; i++){
int v = query(ord[i], k);
if(pos[v] < pos[ord[i]]){
p[ord[i]]= v;
break;
}
else {
p[v] = ord[i];
}
}
}
}
for(int i = 2; i <= N; i++){
answer(i, p[i]);
}
}
Compilation message (stderr)
# | 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... |