結果
| 問題 | No.443 GCD of Permutation | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2025-09-01 01:36:18 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 355 bytes | 
| コンパイル時間 | 325 ms | 
| コンパイル使用メモリ | 82,768 KB | 
| 実行使用メモリ | 73,756 KB | 
| 最終ジャッジ日時 | 2025-09-01 01:36:22 | 
| 合計ジャッジ時間 | 3,321 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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)
            
            
            
        