結果
| 問題 | No.123 カードシャッフル | 
| コンテスト | |
| ユーザー |  togatoga | 
| 提出日時 | 2015-09-03 09:31:05 | 
| 言語 | Python2 (2.7.18) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 688 ms / 5,000 ms | 
| コード長 | 259 bytes | 
| コンパイル時間 | 301 ms | 
| コンパイル使用メモリ | 6,784 KB | 
| 実行使用メモリ | 12,560 KB | 
| 最終ジャッジ日時 | 2024-07-18 21:52:46 | 
| 合計ジャッジ時間 | 2,332 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 10 | 
ソースコード
N,M = map(int, raw_input().split())
A = map(int, raw_input().split())
pos = [0] * (N + 1)
for i in range(1, N + 1):
    pos[i] = i
for x in A:
    tmp = pos[x]
    for y in reversed(range(2, x + 1)):
        pos[y] = pos[y - 1]
    pos[1] = tmp
print pos[1]
            
            
            
        