結果

問題 No.443 GCD of Permutation
ユーザー AEn
提出日時 2023-05-24 01:10:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 239 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 82,828 KB
実行使用メモリ 67,436 KB
最終ジャッジ日時 2024-12-23 09:12:46
合計ジャッジ時間 2,396 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18 RE * 10
権限があれば一括ダウンロードができます

ソースコード

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