結果

問題 No.429 CupShuffle
ユーザー c-yanc-yan
提出日時 2021-02-02 00:46:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 372 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 24,436 KB
最終ジャッジ日時 2023-09-12 10:54:32
合計ジャッジ時間 3,264 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,780 KB
testcase_01 AC 15 ms
7,816 KB
testcase_02 AC 15 ms
7,760 KB
testcase_03 AC 15 ms
7,776 KB
testcase_04 AC 17 ms
7,872 KB
testcase_05 AC 15 ms
7,840 KB
testcase_06 AC 17 ms
7,864 KB
testcase_07 AC 18 ms
7,932 KB
testcase_08 AC 15 ms
7,876 KB
testcase_09 AC 18 ms
7,896 KB
testcase_10 AC 48 ms
9,688 KB
testcase_11 AC 370 ms
24,424 KB
testcase_12 AC 339 ms
24,436 KB
testcase_13 AC 371 ms
24,408 KB
testcase_14 AC 372 ms
24,432 KB
testcase_15 AC 15 ms
7,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K, X = map(int, input().split())

a = list(range(1, N + 1))
for _ in range(K):
    A, B = input().split()
    if A == '?':
        b = a[:]
        continue
    A, B = int(A) - 1, int(B) - 1
    a[A], a[B] = a[B], a[A]
C = list(map(int, input().split()))

c = [C[i] for i in range(N) if C[i] != a[i]]
print(*sorted([b.index(c[0]) + 1, b.index(c[1]) + 1]))
0