結果

問題 No.443 GCD of Permutation
コンテスト
ユーザー nola_suz
提出日時 2016-11-12 01:15:41
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 252 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 141 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 86,528 KB
最終ジャッジ日時 2026-05-01 10:17:48
合計ジャッジ時間 4,700 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 RE * 3
other AC * 1 RE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import random
import fractions
s = input()
n = int(s)
a = [0]*10
for i in s:
	a[int(i)]+=1

ans = n

for i in range(10):
	for j in range(i):
		if a[i] and a[j]:
			if ans < 0:
				ans = 9*(i-j)
			else:
				ans = fractions.gcd(ans, 9*(i-j))

print(ans)
0