結果
問題 |
No.443 GCD of Permutation
|
ユーザー |
|
提出日時 | 2025-09-01 01:49:49 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 380 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 70,632 KB |
最終ジャッジ日時 | 2025-09-01 01:49:53 |
合計ジャッジ時間 | 3,766 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | RE * 28 |
ソースコード
import random import math random.seed(time.time()) s = input(); res = int(''.join(sorted(s))) # 오름차순 정렬한 수 s_rev = int(''.join(sorted(s, reverse=True))) # 내림차순 정렬한 수 res = math.gcd(res, s_rev) s_list = list(s) for _ in range(10): random.shuffle(s_list) shuffled = int(''.join(s_list)) res = math.gcd(res, shuffled) print(res)