結果

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

ソースコード

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]
res=int(string)
for i in itertools.permutations(A):
    res=gcd(res,(int("".join(i))))
    if res==1:break
print(res)
0