結果

問題 No.443 GCD of Permutation
ユーザー kimiyukikimiyuki
提出日時 2016-11-12 19:45:23
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 1,977 ms
コンパイル使用メモリ 77,584 KB
実行使用メモリ 112,172 KB
最終ジャッジ日時 2023-08-17 03:52:27
合計ジャッジ時間 32,903 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 910 ms
111,296 KB
testcase_01 AC 911 ms
111,336 KB
testcase_02 AC 910 ms
111,524 KB
testcase_03 AC 910 ms
111,624 KB
testcase_04 AC 912 ms
111,396 KB
testcase_05 AC 910 ms
111,356 KB
testcase_06 AC 911 ms
111,356 KB
testcase_07 AC 910 ms
111,388 KB
testcase_08 AC 911 ms
111,164 KB
testcase_09 AC 911 ms
111,248 KB
testcase_10 AC 911 ms
111,264 KB
testcase_11 AC 910 ms
111,356 KB
testcase_12 AC 911 ms
111,384 KB
testcase_13 AC 911 ms
111,332 KB
testcase_14 AC 913 ms
111,568 KB
testcase_15 AC 912 ms
111,468 KB
testcase_16 AC 911 ms
111,556 KB
testcase_17 AC 911 ms
111,480 KB
testcase_18 AC 912 ms
111,676 KB
testcase_19 AC 913 ms
111,512 KB
testcase_20 WA -
testcase_21 AC 912 ms
111,432 KB
testcase_22 AC 911 ms
111,388 KB
testcase_23 AC 911 ms
111,252 KB
testcase_24 AC 910 ms
111,164 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 912 ms
111,480 KB
testcase_28 WA -
testcase_29 AC 911 ms
111,696 KB
testcase_30 AC 912 ms
112,076 KB
testcase_31 AC 911 ms
111,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python2
import time
import random
import fractions
s = list(raw_input())
n = int(''.join(s))
d = n
while time.clock() < 0.9:
    i = random.randint(0, len(s)-1)
    j = random.randint(0, len(s)-1)
    n += (ord(s[j]) - ord(s[i])) * 10 ** (len(s)-1-i)
    n += (ord(s[i]) - ord(s[j])) * 10 ** (len(s)-1-j)
    s[i], s[j] = s[j], s[i]
    d = fractions.gcd(d, n)
print(d)
0