結果
| 問題 | No.443 GCD of Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-12 19:30:26 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 138 ms / 1,000 ms |
| + 712µs | |
| コード長 | 293 bytes |
| 記録 | |
| コンパイル時間 | 59 ms |
| コンパイル使用メモリ | 81,212 KB |
| 実行使用メモリ | 100,764 KB |
| 最終ジャッジ日時 | 2026-07-18 10:56:59 |
| 合計ジャッジ時間 | 5,667 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 28 |
ソースコード
from itertools import product
from fractions import gcd
g = input()
digits = sorted(map(eval, str(g)))
if len(set(digits)) == 1:
print g
else:
digit_len = len(str(g))
digits = list(set(digits))
G = g
for x in product(digits, repeat=2):
G = gcd(G, 9 * (x[0] - x[1]))
print G