結果

問題 No.123 カードシャッフル
ユーザー HachimoriHachimori
提出日時 2015-01-11 23:24:44
言語 Python2
(2.7.18)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 353 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 6,672 KB
実行使用メモリ 12,376 KB
最終ジャッジ日時 2023-09-03 23:36:48
合計ジャッジ時間 1,433 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,912 KB
testcase_01 AC 12 ms
5,932 KB
testcase_02 AC 12 ms
5,816 KB
testcase_03 AC 13 ms
5,812 KB
testcase_04 AC 11 ms
5,884 KB
testcase_05 AC 11 ms
5,920 KB
testcase_06 AC 11 ms
6,048 KB
testcase_07 AC 12 ms
5,992 KB
testcase_08 AC 11 ms
5,932 KB
testcase_09 AC 11 ms
5,884 KB
testcase_10 AC 65 ms
7,316 KB
testcase_11 AC 84 ms
12,376 KB
testcase_12 AC 85 ms
11,188 KB
testcase_13 AC 86 ms
11,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python


def read():
    N, M = map(int, raw_input().split())
    return N, map(int, raw_input().split())


def work((N, shuffle)):
    deck = range(N)

    for idx in shuffle:
        idx -= 1

        tmp = deck[idx]
        del deck[idx]
        deck = [tmp] + deck

    print deck[0] + 1


if __name__ == "__main__":
    work(read())
0