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;
void solve(int N){
vector<int> v;
for (int i = 1; i <= N; i++) v.push_back(i);
do{
random_shuffle(v.begin(),v.end());
int val = query(v);
if (val == N) return;
else if (val == N-2){
for (int i = 0; i < N; i++){
for (int j = i+1; j < N; j++){
swap(v[i],v[j]);
if (query(v) == N) return;
swap(v[i],v[j]);
}
}
}
}while(true);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |