結果
問題 | No.443 GCD of Permutation |
ユーザー |
|
提出日時 | 2016-11-19 21:04:37 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 27 ms / 1,000 ms |
コード長 | 222 bytes |
コンパイル時間 | 634 ms |
コンパイル使用メモリ | 6,948 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-10-14 00:02:08 |
合計ジャッジ時間 | 2,357 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
from functools import reducefrom itertools import productfrom fractions import gcdN = 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)))