結果
問題 |
No.443 GCD of Permutation
|
ユーザー |
|
提出日時 | 2025-09-01 01:47:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 231 ms |
コンパイル使用メモリ | 11,904 KB |
実行使用メモリ | 11,904 KB |
最終ジャッジ日時 | 2025-09-01 01:47:52 |
合計ジャッジ時間 | 3,187 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 RE * 10 |
ソースコード
import random import math s = input(); res = int(''.join(sorted(s))) # 오름차순 정렬한 수 s_rev = int(''.join(sorted(s, reverse=True))) # 내림차순 정렬한 수 res = math.gcd(res, s_rev) for _ in range(10): s_list = list(s) random.shuffle(s_list) shuffled = int(''.join(s_list)) res = math.gcd(res, shuffled) print(res)