Submission #429713

# Submission time Handle Problem Language Result Execution time Memory
429713 2021-06-16T08:54:30 Z mosiashvililuka The Collection Game (BOI21_swaps) C++14
0 / 100
132 ms 292 KB
#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];
			}
		}
		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
1 Runtime error 74 ms 292 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 82 ms 288 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 59 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 59 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 83 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 83 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 63 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 63 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 132 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 132 ms 200 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 40 ms 248 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 40 ms 248 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -