結果

問題 No.123 カードシャッフル
ユーザー MamonboMamonbo
提出日時 2015-10-03 19:06:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 327 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 16,472 KB
最終ジャッジ日時 2023-09-27 01:51:43
合計ジャッジ時間 1,856 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,916 KB
testcase_01 AC 16 ms
7,848 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 16 ms
7,952 KB
testcase_04 AC 16 ms
7,908 KB
testcase_05 AC 16 ms
7,872 KB
testcase_06 AC 16 ms
7,860 KB
testcase_07 AC 15 ms
7,920 KB
testcase_08 AC 15 ms
7,864 KB
testcase_09 AC 16 ms
7,784 KB
testcase_10 AC 88 ms
10,180 KB
testcase_11 AC 124 ms
16,472 KB
testcase_12 AC 131 ms
15,296 KB
testcase_13 AC 129 ms
15,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding=UTF-8
#実際にやってみるのがヨロシ と思うよ

mojir=input()
hyo=mojir.split(' ')
N=int(hyo[0])
M=int(hyo[1])

mojir=input()
hyo=mojir.split(' ')
A=[int(mono) for mono in hyo]

cards=list(range(1,N+1,1))

for idx in A:
    cards=[cards[idx-1]]+cards[0:idx-1]+cards[idx:]
#    print(cards)

print(cards[0])
0