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>
#include "grader.h"
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
void solve(int N){
vector<int> v;
vector<int> q;int n = N ;
int ans[N+2] ;
for(int i = 1;i<=N;i++) { v.push_back(i); q.push_back(N+22) ; }
for(int i = 1; i <= n ; i ++ ) {
q[i] = i ;
for(int j = 0 ;j < n ; j ++ ) {
if(query(q) == 1) {ans[j] = i ; break ; }
if(j > 0 )
swap(q[j] , q[j+1]) ;
}
}
vector<int> vv ;
for(int i = 1; i <= N ; i ++ ) {
vv.push_back(ans[i]) ;
}
query(vv);
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |