結果

問題 No.443 GCD of Permutation
コンテスト
ユーザー AEn
提出日時 2023-05-24 01:10:23
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 239 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 832 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 65,408 KB
最終ジャッジ日時 2026-05-29 10:26:24
合計ジャッジ時間 3,414 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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