結果

問題 No.346 チワワ数え上げ問題
ユーザー akitsugu777akitsugu777
提出日時 2019-07-30 17:32:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 247 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 13,140 KB
最終ジャッジ日時 2023-09-18 11:27:25
合計ジャッジ時間 14,819 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
12,404 KB
testcase_01 AC 16 ms
7,944 KB
testcase_02 AC 17 ms
7,904 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 16 ms
7,940 KB
testcase_05 AC 16 ms
7,948 KB
testcase_06 AC 16 ms
7,828 KB
testcase_07 AC 16 ms
7,996 KB
testcase_08 AC 16 ms
7,872 KB
testcase_09 AC 16 ms
7,896 KB
testcase_10 AC 1,756 ms
8,336 KB
testcase_11 AC 449 ms
8,304 KB
testcase_12 AC 913 ms
8,352 KB
testcase_13 AC 305 ms
7,936 KB
testcase_14 AC 17 ms
7,908 KB
testcase_15 AC 776 ms
8,280 KB
testcase_16 AC 1,121 ms
8,268 KB
testcase_17 AC 1,798 ms
8,324 KB
testcase_18 AC 1,709 ms
8,304 KB
testcase_19 AC 1,229 ms
8,200 KB
testcase_20 AC 177 ms
8,052 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

s = input()

c = 0
for i in range(len(s)):
    if s[i] == 'c':
        if 'w' in s:
            w = s[i:].count('w')
            if w > 1:
                c +=  math.factorial(w) // (math.factorial(w - 2) * math.factorial(2))
print(c)
0