結果
| 問題 |
No.101 ぐるぐる!あみだくじ!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-18 04:42:18 |
| 言語 | Python2 (2.7.18) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 255 bytes |
| コンパイル時間 | 71 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 13,216 KB |
| 最終ジャッジ日時 | 2024-06-23 21:01:34 |
| 合計ジャッジ時間 | 6,890 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 11 TLE * 1 -- * 25 |
ソースコード
N = int(raw_input())
K = int(raw_input())
s = range(N)
for loop in xrange(K):
X,Y = map(int,raw_input().split())
X -= 1; Y -= 1
s[X],s[Y] = s[Y],s[X]
a = s[:]
ans = 1
while a != range(N):
a = [a[i] for i in s]
ans += 1
print ans