結果

問題 No.443 GCD of Permutation
ユーザー vockyX
提出日時 2016-11-11 23:02:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 239 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,504 KB
最終ジャッジ日時 2024-11-25 09:16:37
合計ジャッジ時間 17,860 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10 RE * 10 TLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
string = input()
A=[i for i in string]
B=[]
res=int(string)
for i in itertools.permutations(A):
    res=gcd(res,(int("".join(i))))
print(res)
0