結果

問題 No.443 GCD of Permutation
ユーザー convexineqconvexineq
提出日時 2021-02-05 07:48:16
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 264 bytes
コンパイル時間 1,037 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 80,376 KB
最終ジャッジ日時 2023-09-14 13:07:21
合計ジャッジ時間 5,994 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,288 KB
testcase_01 AC 75 ms
71,408 KB
testcase_02 AC 74 ms
71,112 KB
testcase_03 AC 76 ms
71,600 KB
testcase_04 AC 76 ms
71,276 KB
testcase_05 AC 77 ms
71,084 KB
testcase_06 AC 76 ms
71,496 KB
testcase_07 AC 76 ms
71,312 KB
testcase_08 AC 75 ms
71,236 KB
testcase_09 AC 74 ms
71,360 KB
testcase_10 AC 73 ms
71,584 KB
testcase_11 AC 75 ms
71,188 KB
testcase_12 AC 74 ms
71,496 KB
testcase_13 AC 76 ms
71,548 KB
testcase_14 AC 80 ms
75,564 KB
testcase_15 AC 78 ms
76,216 KB
testcase_16 AC 78 ms
76,092 KB
testcase_17 AC 78 ms
76,184 KB
testcase_18 RE -
testcase_19 AC 77 ms
76,228 KB
testcase_20 RE -
testcase_21 AC 79 ms
75,916 KB
testcase_22 AC 73 ms
71,572 KB
testcase_23 AC 73 ms
71,596 KB
testcase_24 AC 74 ms
71,672 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
if all(s[0]==si for si in s):
    print(s)
    exit()

r = [0]*10
for i in s:
    r[int(i)] = 1

c = 0
from math import gcd
for i in range(10):
    for j in range(i+1,10):
        if r[i] == r[j] == 1:
            c = gcd(c,j-i)

print(gcd(int(s),c*9))
0