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>
#define ll long long
#define endl '\n'
#define pb push_back
using namespace std;
const ll mx=100006;
#include "xylophone.h"
static int A[5000];
void solve(int N) {
int n=N;
int r=n-1,op=2;
int value = query(1, N-1);
while(1<r&&value!=n-1)
{
r--;
value = query(1, r);
if(value!=n-1)op=r+1;
}
A[op]=1;
for(int i = 1; i <= n; i++) {
if(i==op)continue;
ll x=query(min(op,i), max(op,i));
A[i]=1+x;
}
for(int i=1;i<=n;i++)
{
answer(i,A[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... |