結果

問題 No.443 GCD of Permutation
ユーザー AEnAEn
提出日時 2023-05-24 01:10:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 239 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 79,124 KB
最終ジャッジ日時 2023-08-24 22:48:34
合計ジャッジ時間 4,862 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,312 KB
testcase_01 AC 69 ms
71,336 KB
testcase_02 AC 71 ms
71,308 KB
testcase_03 AC 74 ms
71,016 KB
testcase_04 AC 70 ms
71,168 KB
testcase_05 AC 71 ms
71,336 KB
testcase_06 AC 70 ms
71,296 KB
testcase_07 AC 71 ms
71,172 KB
testcase_08 AC 71 ms
71,316 KB
testcase_09 AC 71 ms
71,164 KB
testcase_10 AC 71 ms
71,256 KB
testcase_11 AC 72 ms
71,328 KB
testcase_12 AC 71 ms
71,388 KB
testcase_13 AC 70 ms
71,496 KB
testcase_14 RE -
testcase_15 AC 71 ms
71,224 KB
testcase_16 AC 72 ms
71,236 KB
testcase_17 AC 71 ms
71,548 KB
testcase_18 RE -
testcase_19 AC 70 ms
71,336 KB
testcase_20 RE -
testcase_21 AC 72 ms
71,284 KB
testcase_22 AC 71 ms
71,212 KB
testcase_23 AC 71 ms
71,152 KB
testcase_24 AC 70 ms
71,236 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
S = int(input())

s = set(list(str(S)))
if len(s)==1:
    print(S)
else:
    mn = 10
    for a in s:
        for b in s:
            if a==b:continue
            mn = min(mn,abs(int(a)-int(b)))

    print(math.gcd(9*mn,S))
    
0