結果

問題 No.443 GCD of Permutation
ユーザー dpforest
提出日時 2017-06-23 13:45:30
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 374 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-03 04:09:53
合計ジャッジ時間 1,963 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

num = input()
digits = list(map(int, list(num)))
ans = 1

if all(d%8 == 0 for d in digits):
  ans *= 8
elif all(d%4 == 0 for d in digits):
  ans *= 4
elif all(d%2 == 0 for d in digits):
  ans *= 2

if sum(digits)%9 == 0:
  ans *= 9
elif sum(digits)%3 == 0:
  ans *= 3
  
if all(d%5 == 0 for d in digits):
  ans *= 5

if len(set(digits)) == 1:
  print(num)
else:
  print(ans)
0