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 "swaps.h"
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,V,bo[5009],p[5009],pi,q[5009],qi;
vector <int> vv,ans;
void solve(int N, int VV) {
a=N;V=VV;
for(ii=1; ii<a; ii++){
pi=0;
for(i=1; i<=a; i++){
if(bo[i]==1) continue;
pi++;p[pi]=i;
}
while(pi!=1){
for(i=1; i<pi; i+=2){
schedule(p[i],p[i+1]);
}
vv=visit();
qi=0;
j=-1;
for(i=1; i<pi; i+=2){
j++;
if(vv[j]==1){
qi++;q[qi]=p[i];
}else{
qi++;q[qi]=p[i+1];
}
}
if(pi%2==1){
qi++;q[qi]=p[pi];
}
pi=qi;
for(i=1; i<=pi; i++){
p[i]=q[i];
}
}
ans.push_back(p[1]);
bo[p[1]]=1;
}
for(i=1; i<=a; i++){
if(bo[i]==0){
ans.push_back(i);break;
}
}
answer(ans);
}
# | 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... |
# | 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... |