結果
問題 |
No.443 GCD of Permutation
|
ユーザー |
👑 ![]() |
提出日時 | 2025-07-28 04:01:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 559 bytes |
コンパイル時間 | 285 ms |
コンパイル使用メモリ | 81,924 KB |
実行使用メモリ | 77,644 KB |
最終ジャッジ日時 | 2025-07-28 04:02:13 |
合計ジャッジ時間 | 29,210 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 WA * 4 |
ソースコード
""" https://yukicoder.me/problems/no/443 桁が多い場合はほとんど1になりそうなんだよな 小さい場合は無作為shuffleでも効きそう """ import math import random import sys # 制限を解除(無制限にしたい場合は0を指定) sys.set_int_max_str_digits(0) 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)