結果

問題 No.429 CupShuffle
ユーザー h_nosonh_noson
提出日時 2017-01-26 13:59:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 406 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 24,660 KB
最終ジャッジ日時 2023-08-24 23:59:47
合計ジャッジ時間 3,418 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,860 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 15 ms
7,868 KB
testcase_03 AC 15 ms
7,820 KB
testcase_04 AC 17 ms
7,764 KB
testcase_05 AC 16 ms
7,924 KB
testcase_06 AC 18 ms
7,860 KB
testcase_07 AC 19 ms
7,928 KB
testcase_08 AC 15 ms
7,820 KB
testcase_09 AC 18 ms
7,760 KB
testcase_10 AC 53 ms
9,876 KB
testcase_11 AC 406 ms
24,340 KB
testcase_12 AC 381 ms
23,804 KB
testcase_13 AC 398 ms
24,272 KB
testcase_14 AC 404 ms
24,660 KB
testcase_15 AC 15 ms
7,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

[n,k,x] = map(int,input().split(' '))
x -= 1
s = [i for i in range(1,n+1)]
tmp = s[:]
for i in range(k):
    if i == x:
        input()
        continue
    [a,b] = map(int,input().split(' '))
    a -= 1
    b -= 1
    s[a],s[b] = s[b],s[a]
    if i == x-1:
        tmp = s[:]
c = list(map(int,input().split(' ')))
t = [s[i] for i in range(n) if s[i] != c[i]]
for i in range(n):
    if tmp[i] in t:
        print(i+1,end=' ')
print("")
0