結果

問題 No.443 GCD of Permutation
ユーザー ayaoniayaoni
提出日時 2020-11-25 01:10:54
言語 PyPy3
(7.3.15)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 276 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 86,308 KB
実行使用メモリ 79,908 KB
最終ジャッジ日時 2023-10-01 01:25:36
合計ジャッジ時間 5,926 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,124 KB
testcase_01 AC 80 ms
71,308 KB
testcase_02 AC 74 ms
71,236 KB
testcase_03 AC 72 ms
71,244 KB
testcase_04 AC 75 ms
71,436 KB
testcase_05 AC 74 ms
71,312 KB
testcase_06 AC 75 ms
71,236 KB
testcase_07 AC 77 ms
71,188 KB
testcase_08 AC 75 ms
70,908 KB
testcase_09 AC 74 ms
71,296 KB
testcase_10 AC 75 ms
71,236 KB
testcase_11 AC 75 ms
71,152 KB
testcase_12 AC 75 ms
71,164 KB
testcase_13 AC 76 ms
71,316 KB
testcase_14 RE -
testcase_15 AC 78 ms
75,876 KB
testcase_16 AC 77 ms
76,104 KB
testcase_17 AC 77 ms
75,940 KB
testcase_18 RE -
testcase_19 AC 79 ms
75,900 KB
testcase_20 RE -
testcase_21 AC 77 ms
75,888 KB
testcase_22 AC 73 ms
71,484 KB
testcase_23 AC 73 ms
71,176 KB
testcase_24 AC 74 ms
71,364 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import gcd
def S(): return sys.stdin.readline().rstrip()


N = S()

flag = [0]*10
for n in N:
    flag[int(n)] = 1

X = [i for i in range(10) if flag[i] == 1]
g = 0
for i in range(len(X)-1):
    g = gcd(g,X[i+1]-X[i])
g *= 9
print(gcd(g,int(''.join(N))))
0