結果

問題 No.443 GCD of Permutation
ユーザー vockyXvockyX
提出日時 2016-11-11 22:54:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 277 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 160,176 KB
最終ジャッジ日時 2024-11-25 08:43:18
合計ジャッジ時間 17,977 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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=[]
for i in itertools.permutations(A):
    B.append((int("".join(i))))
res=B[0]
for i in range(1,len(B)):
    res=gcd(B[i],res)
print(res)
0