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;
#define sp " "
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define pb push_back
#define pii pair<int, int>
#define st first
#define nd second
#define LL node * 2
#define RR node * 2 + 1
const int modulo = 1e9 + 7;
void solve(int N, int L) {
vector<int> v, pos(N + 5, 0), done(N + 5, 0);
for (int i = 1; i <= N -1; i++){
int tmp = query(1, i);
v.pb(tmp);
pos[tmp] = i - 1;
}
for (auto i : v){
if (done[i]) continue;
int to = query(i, 1);
int curr = 1;
while(pos[to] > pos[i]){
answer(to, i);
done[to] = 1;
curr++;
to = query(i, curr);
}
answer(to, 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... |