結果

問題 No.443 GCD of Permutation
ユーザー 👑 rin204rin204
提出日時 2022-03-23 21:29:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 464 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,368 KB
実行使用メモリ 62,884 KB
最終ジャッジ日時 2024-04-20 05:25:09
合計ジャッジ時間 2,434 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 36 ms
52,480 KB
testcase_02 WA -
testcase_03 AC 38 ms
53,364 KB
testcase_04 AC 38 ms
53,536 KB
testcase_05 AC 37 ms
52,528 KB
testcase_06 AC 38 ms
52,368 KB
testcase_07 AC 33 ms
53,644 KB
testcase_08 AC 32 ms
53,212 KB
testcase_09 AC 40 ms
52,812 KB
testcase_10 AC 37 ms
53,368 KB
testcase_11 WA -
testcase_12 AC 37 ms
52,544 KB
testcase_13 AC 36 ms
52,960 KB
testcase_14 AC 37 ms
52,652 KB
testcase_15 AC 43 ms
60,616 KB
testcase_16 AC 40 ms
58,260 KB
testcase_17 AC 39 ms
59,308 KB
testcase_18 AC 41 ms
59,536 KB
testcase_19 AC 41 ms
58,976 KB
testcase_20 AC 42 ms
59,404 KB
testcase_21 AC 42 ms
57,976 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 44 ms
61,796 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 40 ms
60,032 KB
testcase_29 WA -
testcase_30 AC 46 ms
62,884 KB
testcase_31 AC 40 ms
60,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
if len(set(n)) == 1:
    print(n)
    exit()
tot = sum(map(int, n))
if tot % 9 == 0:
    ans = 9
elif tot % 3 == 0:
    ans = 3
else:
    ans = 1
if all(int(x) % 4 == 0 for x in n):
    ans *= 4
elif all(int(x) % 2 == 0 for x in n):
    ans *= 2
if all(int(x) % 5 == 0 for x in n):
    ans *= 5
if len(set(n)) == 2 and "0" in n:
    for s in n:
        if s != "0":
            ans *= [0, 1, 1, 1, 1, 1, 1, 7, 2, 0][int(s)]
            break
print(ans)
0