結果

問題 No.2201 p@$$w0rd
ユーザー 👑 rin204rin204
提出日時 2023-02-03 21:24:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 71,156 KB
最終ジャッジ日時 2023-09-15 16:44:06
合計ジャッジ時間 3,146 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,152 KB
testcase_01 AC 72 ms
70,824 KB
testcase_02 AC 71 ms
71,156 KB
testcase_03 AC 71 ms
70,592 KB
testcase_04 AC 70 ms
70,900 KB
testcase_05 AC 71 ms
70,996 KB
testcase_06 AC 72 ms
71,132 KB
testcase_07 AC 72 ms
71,060 KB
testcase_08 AC 70 ms
71,016 KB
testcase_09 AC 71 ms
70,896 KB
testcase_10 AC 71 ms
70,900 KB
testcase_11 AC 71 ms
70,608 KB
testcase_12 AC 70 ms
70,960 KB
testcase_13 AC 71 ms
70,592 KB
testcase_14 AC 71 ms
71,032 KB
testcase_15 AC 71 ms
71,004 KB
testcase_16 AC 73 ms
71,036 KB
testcase_17 AC 71 ms
70,904 KB
testcase_18 AC 70 ms
70,908 KB
testcase_19 AC 72 ms
71,148 KB
testcase_20 AC 72 ms
70,820 KB
testcase_21 AC 71 ms
70,712 KB
testcase_22 AC 72 ms
71,016 KB
testcase_23 AC 72 ms
70,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
l = S.count('l') + S.count('o')
a = S.count('a') + S.count('s')

def nCk(n, k):
    ret = 1
    for i in range(n, n - k, -1):
        ret *= i
    for i in range(1, k + 1):
        ret //= i
    return ret

ans = 0
for i in range(1, l + 1):
    for j in range(1, a + 1):
        if i + j != 8:
            ans += nCk(l, i) * nCk(a, j)
print(ans)
0