結果

問題 No.443 GCD of Permutation
ユーザー dpforestdpforest
提出日時 2017-06-23 13:42:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-14 06:55:57
合計ジャッジ時間 2,675 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 29 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 WA -
testcase_10 AC 29 ms
10,752 KB
testcase_11 WA -
testcase_12 AC 30 ms
10,752 KB
testcase_13 AC 30 ms
10,752 KB
testcase_14 AC 34 ms
11,008 KB
testcase_15 AC 31 ms
10,752 KB
testcase_16 AC 29 ms
10,752 KB
testcase_17 AC 29 ms
10,752 KB
testcase_18 AC 31 ms
11,008 KB
testcase_19 AC 30 ms
10,752 KB
testcase_20 AC 31 ms
10,880 KB
testcase_21 AC 31 ms
10,752 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 31 ms
10,880 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 33 ms
10,880 KB
testcase_29 WA -
testcase_30 AC 34 ms
10,880 KB
testcase_31 AC 33 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if 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