結果

問題 No.429 CupShuffle
ユーザー matriematrie
提出日時 2021-02-24 23:22:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 505 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 11,852 KB
実行使用メモリ 54,528 KB
最終ジャッジ日時 2023-10-25 04:38:41
合計ジャッジ時間 3,873 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,376 KB
testcase_01 AC 29 ms
10,096 KB
testcase_02 AC 28 ms
10,096 KB
testcase_03 AC 29 ms
10,096 KB
testcase_04 AC 31 ms
10,312 KB
testcase_05 AC 28 ms
10,096 KB
testcase_06 AC 33 ms
10,384 KB
testcase_07 AC 32 ms
10,380 KB
testcase_08 AC 29 ms
10,100 KB
testcase_09 AC 32 ms
10,364 KB
testcase_10 AC 67 ms
14,516 KB
testcase_11 AC 505 ms
54,528 KB
testcase_12 AC 439 ms
54,528 KB
testcase_13 AC 489 ms
54,528 KB
testcase_14 AC 489 ms
54,512 KB
testcase_15 AC 29 ms
10,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k,t=map(int,input().split())
L=[0]*k
for i in range(k):L[i]=input().split()

A=list(range(1,n+1))
for i in range(t-1):
	x,y=int(L[i][0])-1,int(L[i][1])-1
	A[x],A[y]=A[y],A[x]

B=list(map(int,input().split()))
for i in range(k-1,t-1,-1):
	x,y=int(L[i][0])-1,int(L[i][1])-1
	B[x],B[y]=B[y],B[x]

C=[]
for i in range(n):
	if A[i]!=B[i]:C.append(i+1)
print(*C)
0