結果

問題 No.2201 p@$$w0rd
ユーザー kenshi4041kenshi4041
提出日時 2023-02-03 21:44:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 71,680 KB
最終ジャッジ日時 2023-09-15 17:25:03
合計ジャッジ時間 2,888 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,376 KB
testcase_01 AC 67 ms
71,680 KB
testcase_02 AC 68 ms
71,636 KB
testcase_03 AC 67 ms
71,268 KB
testcase_04 AC 68 ms
71,628 KB
testcase_05 AC 68 ms
71,660 KB
testcase_06 AC 68 ms
71,124 KB
testcase_07 WA -
testcase_08 AC 69 ms
71,376 KB
testcase_09 AC 68 ms
71,116 KB
testcase_10 WA -
testcase_11 AC 70 ms
71,276 KB
testcase_12 WA -
testcase_13 AC 68 ms
71,256 KB
testcase_14 AC 69 ms
71,460 KB
testcase_15 WA -
testcase_16 AC 69 ms
71,304 KB
testcase_17 AC 69 ms
71,372 KB
testcase_18 AC 69 ms
71,560 KB
testcase_19 AC 70 ms
71,056 KB
testcase_20 AC 71 ms
71,488 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 69 ms
71,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import factorial
s = input()
num = 0
kigou = 0

for i in s:
    if i == "l" or i == "o":
        num += 1
    if i == "a" or i == "s":
        kigou += 1

if num == 0 or kigou == 0:
    print(0)
else:
    n = num
    nums = 0
    for r in range(1, n + 1):
        nums += factorial(n) / (factorial(r) * factorial(n-r))
    n = kigou
    kigous = 0
    for r in range(1, n + 1):
        kigous += factorial(n) / (factorial(r) * factorial(n-r))

    print(int(nums * kigous))
0