結果

問題 No.429 CupShuffle
ユーザー matriematrie
提出日時 2021-02-24 23:35:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 461 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 11,964 KB
実行使用メモリ 50,708 KB
最終ジャッジ日時 2023-10-25 04:48:47
合計ジャッジ時間 3,664 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,464 KB
testcase_01 AC 27 ms
10,192 KB
testcase_02 AC 27 ms
10,192 KB
testcase_03 AC 27 ms
10,192 KB
testcase_04 AC 29 ms
10,400 KB
testcase_05 AC 27 ms
10,192 KB
testcase_06 AC 31 ms
10,472 KB
testcase_07 AC 30 ms
10,468 KB
testcase_08 AC 27 ms
10,196 KB
testcase_09 AC 31 ms
10,452 KB
testcase_10 AC 70 ms
14,220 KB
testcase_11 AC 461 ms
50,708 KB
testcase_12 AC 428 ms
50,704 KB
testcase_13 AC 457 ms
50,708 KB
testcase_14 AC 451 ms
50,688 KB
testcase_15 AC 28 ms
10,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

i,r=input,range
n,k,t=map(int,i().split())
L=[0]*k
for j in r(k):L[j]=i().split()
B=list(map(int,i().split()))
A=sorted(B)
for j in r(t-1):
	x,y=int(L[j][0])-1,int(L[j][1])-1
	A[x],A[y]=A[y],A[x]
for j in r(k-1,t-1,-1):
	x,y=int(L[j][0])-1,int(L[j][1])-1
	B[x],B[y]=B[y],B[x]
C=[]
for j in r(n):
	if A[j]!=B[j]:C.append(j+1)
print(*C)
0