結果

問題 No.443 GCD of Permutation
ユーザー 👑 SPD_9X2
提出日時 2025-07-28 03:59:34
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 453 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 82,668 KB
実行使用メモリ 77,512 KB
最終ジャッジ日時 2025-07-28 03:59:56
合計ジャッジ時間 22,021 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 18 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

https://yukicoder.me/problems/no/443

桁が多い場合はほとんど1になりそうなんだよな
小さい場合は無作為shuffleでも効きそう

"""

import math
import random

N = list(input())

import time

start = time.time()
ans = 0

while True:

    random.shuffle(N)
    X = int("".join(N))
    ans = math.gcd(X,ans)
    
    # 0.8秒経ったらループを抜ける
    if time.time() - start > 0.8:
        break

print (ans)
0