結果

問題 No.429 CupShuffle
コンテスト
ユーザー matrie
提出日時 2021-02-24 23:35:26
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 353 ms / 2,000 ms
+ 291µs
コード長 334 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 309 ms
コンパイル使用メモリ 21,472 KB
実行使用メモリ 45,900 KB
最終ジャッジ日時 2026-09-03 15:03:10
合計ジャッジ時間 4,907 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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