結果

問題 No.101 ぐるぐる!あみだくじ!
ユーザー roiti46roiti46
提出日時 2015-02-18 04:43:04
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 255 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 77,976 KB
実行使用メモリ 155,956 KB
最終ジャッジ日時 2023-09-06 01:59:28
合計ジャッジ時間 17,255 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
155,956 KB
testcase_01 AC 90 ms
79,228 KB
testcase_02 AC 92 ms
79,060 KB
testcase_03 AC 79 ms
77,376 KB
testcase_04 AC 77 ms
77,428 KB
testcase_05 AC 91 ms
79,304 KB
testcase_06 AC 78 ms
77,260 KB
testcase_07 AC 86 ms
78,924 KB
testcase_08 AC 87 ms
79,052 KB
testcase_09 AC 84 ms
78,624 KB
testcase_10 AC 86 ms
78,520 KB
testcase_11 AC 678 ms
79,072 KB
testcase_12 AC 723 ms
79,188 KB
testcase_13 AC 695 ms
79,428 KB
testcase_14 AC 999 ms
78,928 KB
testcase_15 AC 149 ms
79,276 KB
testcase_16 AC 162 ms
79,416 KB
testcase_17 AC 173 ms
79,016 KB
testcase_18 AC 201 ms
79,140 KB
testcase_19 AC 213 ms
79,276 KB
testcase_20 AC 91 ms
79,272 KB
testcase_21 AC 94 ms
79,260 KB
testcase_22 AC 290 ms
79,260 KB
testcase_23 AC 187 ms
79,464 KB
testcase_24 AC 1,940 ms
78,928 KB
testcase_25 AC 1,276 ms
79,436 KB
testcase_26 AC 919 ms
79,372 KB
testcase_27 TLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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
    
0