답안 #429719

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
429719 2021-06-16T08:55:30 Z mosiashvililuka The Collection Game (BOI21_swaps) C++14
25 / 100
119 ms 440 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];
			}
			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);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 10 ms 200 KB Correct
3 Correct 21 ms 308 KB Correct
4 Correct 81 ms 440 KB Correct
5 Correct 85 ms 308 KB Correct
6 Correct 101 ms 436 KB Correct
7 Correct 118 ms 312 KB Correct
8 Correct 96 ms 316 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 10 ms 300 KB Correct
3 Correct 40 ms 288 KB Correct
4 Correct 90 ms 316 KB Correct
5 Correct 109 ms 316 KB Correct
6 Correct 82 ms 312 KB Correct
7 Correct 105 ms 308 KB Correct
8 Correct 103 ms 304 KB Correct
9 Runtime error 24 ms 304 KB Execution killed with signal 13
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 200 KB Correct
2 Correct 13 ms 300 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 200 KB Correct
2 Correct 13 ms 300 KB Correct
3 Correct 1 ms 200 KB Correct
4 Correct 10 ms 304 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 10 ms 304 KB Correct
3 Correct 42 ms 292 KB Correct
4 Correct 112 ms 420 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 10 ms 304 KB Correct
3 Correct 42 ms 292 KB Correct
4 Correct 112 ms 420 KB Correct
5 Correct 1 ms 200 KB Correct
6 Correct 10 ms 296 KB Correct
7 Correct 32 ms 288 KB Correct
8 Correct 92 ms 316 KB Correct
9 Correct 91 ms 308 KB Correct
10 Correct 85 ms 300 KB Correct
11 Correct 107 ms 336 KB Correct
12 Correct 94 ms 420 KB Correct
13 Correct 1 ms 200 KB Correct
14 Correct 11 ms 200 KB Correct
15 Correct 38 ms 292 KB Correct
16 Correct 117 ms 308 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 6 ms 304 KB Correct
3 Correct 44 ms 304 KB Correct
4 Correct 114 ms 316 KB Correct
5 Runtime error 19 ms 292 KB Execution killed with signal 13
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 6 ms 304 KB Correct
3 Correct 44 ms 304 KB Correct
4 Correct 114 ms 316 KB Correct
5 Runtime error 19 ms 292 KB Execution killed with signal 13
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 200 KB Correct
2 Correct 8 ms 200 KB Correct
3 Correct 25 ms 296 KB Correct
4 Correct 119 ms 424 KB Correct
5 Runtime error 20 ms 288 KB Execution killed with signal 13
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 200 KB Correct
2 Correct 8 ms 200 KB Correct
3 Correct 25 ms 296 KB Correct
4 Correct 119 ms 424 KB Correct
5 Runtime error 20 ms 288 KB Execution killed with signal 13
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 5 ms 300 KB Correct
3 Correct 25 ms 308 KB Correct
4 Correct 111 ms 324 KB Correct
5 Runtime error 15 ms 292 KB Execution killed with signal 13
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 5 ms 300 KB Correct
3 Correct 25 ms 308 KB Correct
4 Correct 111 ms 324 KB Correct
5 Runtime error 15 ms 292 KB Execution killed with signal 13
6 Halted 0 ms 0 KB -