結果
| 問題 | No.443 GCD of Permutation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-19 21:04:37 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 151 ms / 1,000 ms |
| コード長 | 222 bytes |
| 記録 | |
| コンパイル時間 | 343 ms |
| コンパイル使用メモリ | 76,956 KB |
| 最終ジャッジ日時 | 2025-12-03 22:48:19 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 28 |
ソースコード
from functools import reduce from itertools import product from fractions import gcd N = int(input()) s = list(map(int, set(str(N)))) diff = [9 * abs(x - y) for x, y in product(s, s)] print(gcd(N, reduce(gcd, diff, 0)))