結果
| 問題 | No.101 ぐるぐる!あみだくじ! |
| コンテスト | |
| ユーザー |
HIROPON87069639
|
| 提出日時 | 2016-02-15 22:09:48 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 76,964 KB |
| 最終ジャッジ日時 | 2025-12-03 19:22:39 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 25 TLE * 1 -- * 11 |
ソースコード
# -*- coding: utf-8 -*-
N = input()
K = input()
Alist = [i+1 for i in range(0, N)]
Blist = [i+1 for i in range(0, N)]
Klist = [0 for i in range(0, K)]
for i in range(0, K):
Klist[i] = map(int, raw_input().split())[0] - 1
for i in Klist:
Alist[i], Alist[i+1] = Alist[i+1], Alist[i]
flag = 0
cnt = 1
while Alist != Blist:
cnt += 1
for i in Klist:
Alist[i], Alist[i+1] = Alist[i+1], Alist[i]
print cnt
HIROPON87069639