結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 32 ms
52,536 KB
testcase_02 AC 34 ms
53,584 KB
testcase_03 AC 33 ms
53,560 KB
testcase_04 AC 33 ms
51,824 KB
testcase_05 AC 32 ms
53,236 KB
testcase_06 AC 32 ms
53,252 KB
testcase_07 AC 32 ms
52,064 KB
testcase_08 AC 36 ms
52,872 KB
testcase_09 AC 33 ms
52,808 KB
testcase_10 AC 36 ms
53,040 KB
testcase_11 WA -
testcase_12 AC 33 ms
52,408 KB
testcase_13 AC 32 ms
52,508 KB
testcase_14 AC 33 ms
53,688 KB
testcase_15 AC 38 ms
61,188 KB
testcase_16 AC 35 ms
59,036 KB
testcase_17 AC 39 ms
61,188 KB
testcase_18 AC 36 ms
58,900 KB
testcase_19 AC 35 ms
57,980 KB
testcase_20 AC 36 ms
59,720 KB
testcase_21 AC 34 ms
59,316 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 41 ms
61,116 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 37 ms
58,836 KB
testcase_29 WA -
testcase_30 AC 40 ms
62,532 KB
testcase_31 AC 37 ms
60,236 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, 1][int(s)]
            break
print(ans)
0