結果

問題 No.443 GCD of Permutation
ユーザー 👑 rin204rin204
提出日時 2022-03-23 21:27:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 63,004 KB
最終ジャッジ日時 2024-04-20 05:20:30
合計ジャッジ時間 2,501 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 40 ms
52,252 KB
testcase_02 AC 38 ms
52,740 KB
testcase_03 AC 37 ms
52,672 KB
testcase_04 AC 38 ms
53,284 KB
testcase_05 AC 38 ms
52,340 KB
testcase_06 AC 37 ms
52,300 KB
testcase_07 AC 38 ms
52,348 KB
testcase_08 AC 38 ms
52,704 KB
testcase_09 WA -
testcase_10 AC 38 ms
52,616 KB
testcase_11 WA -
testcase_12 AC 38 ms
51,940 KB
testcase_13 AC 38 ms
52,236 KB
testcase_14 AC 38 ms
53,416 KB
testcase_15 AC 45 ms
60,008 KB
testcase_16 AC 41 ms
58,348 KB
testcase_17 AC 45 ms
60,008 KB
testcase_18 AC 42 ms
59,020 KB
testcase_19 AC 41 ms
58,276 KB
testcase_20 AC 41 ms
58,572 KB
testcase_21 AC 41 ms
58,656 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 44 ms
61,664 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 41 ms
58,976 KB
testcase_29 WA -
testcase_30 AC 46 ms
63,004 KB
testcase_31 AC 41 ms
59,420 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
print(ans)
0