結果

問題 No.123 カードシャッフル
ユーザー GrayCoderGrayCoder
提出日時 2017-10-08 15:37:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 148 ms / 5,000 ms
コード長 280 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,224 KB
最終ジャッジ日時 2024-04-28 13:28:29
合計ジャッジ時間 1,306 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,624 KB
testcase_01 AC 25 ms
10,624 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 27 ms
10,624 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 26 ms
10,624 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 25 ms
10,624 KB
testcase_10 AC 55 ms
12,740 KB
testcase_11 AC 148 ms
17,224 KB
testcase_12 AC 111 ms
16,628 KB
testcase_13 AC 108 ms
16,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

def main():
    N, M = map(int, input().split())
    A = tuple(map(int, input().split()))

    card = deque(range(1, N + 1))
    for i in A:
        x = card[i-1]
        card.remove(card[i-1])
        card.appendleft(x)

    print(card[0])

main()
0