結果
| 問題 | No.101 ぐるぐる!あみだくじ! |
| コンテスト | |
| ユーザー |
HIROPON87069639
|
| 提出日時 | 2016-02-15 22:09:48 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 428 bytes |
| 記録 | |
| コンパイル時間 | 67 ms |
| コンパイル使用メモリ | 81,408 KB |
| 実行使用メモリ | 84,224 KB |
| 最終ジャッジ日時 | 2026-07-18 02:57:30 |
| 合計ジャッジ時間 | 22,068 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 27 TLE * 1 -- * 9 |
ソースコード
# -*- 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