結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 35 ms
51,968 KB
testcase_02 AC 34 ms
52,096 KB
testcase_03 AC 33 ms
52,096 KB
testcase_04 AC 33 ms
52,352 KB
testcase_05 AC 34 ms
51,968 KB
testcase_06 AC 32 ms
52,352 KB
testcase_07 AC 34 ms
51,968 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 33 ms
52,352 KB
testcase_11 WA -
testcase_12 AC 32 ms
51,712 KB
testcase_13 AC 35 ms
51,968 KB
testcase_14 AC 33 ms
52,520 KB
testcase_15 AC 37 ms
59,520 KB
testcase_16 AC 34 ms
58,240 KB
testcase_17 AC 38 ms
59,464 KB
testcase_18 AC 36 ms
58,112 KB
testcase_19 AC 36 ms
57,600 KB
testcase_20 AC 35 ms
58,752 KB
testcase_21 AC 36 ms
57,984 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 39 ms
59,904 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 36 ms
58,112 KB
testcase_29 WA -
testcase_30 AC 42 ms
61,440 KB
testcase_31 AC 36 ms
58,752 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 *= 2
print(ans)
0