結果
| 問題 |
No.443 GCD of Permutation
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-01 01:50:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 391 bytes |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 82,896 KB |
| 実行使用メモリ | 73,492 KB |
| 最終ジャッジ日時 | 2025-09-01 01:50:28 |
| 合計ジャッジ時間 | 3,278 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 RE * 10 |
ソースコード
import random
import math
import time
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)