結果

問題 No.346 チワワ数え上げ問題
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 22:33:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 200 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 11,740 KB
実行使用メモリ 14,632 KB
最終ジャッジ日時 2023-10-26 03:14:26
合計ジャッジ時間 12,548 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
14,408 KB
testcase_01 AC 29 ms
10,056 KB
testcase_02 AC 29 ms
10,056 KB
testcase_03 AC 29 ms
10,056 KB
testcase_04 AC 29 ms
10,060 KB
testcase_05 AC 29 ms
10,056 KB
testcase_06 AC 29 ms
10,060 KB
testcase_07 AC 29 ms
10,056 KB
testcase_08 AC 28 ms
10,060 KB
testcase_09 AC 29 ms
10,060 KB
testcase_10 AC 1,430 ms
10,284 KB
testcase_11 AC 364 ms
10,256 KB
testcase_12 AC 733 ms
10,296 KB
testcase_13 AC 248 ms
10,188 KB
testcase_14 AC 30 ms
10,060 KB
testcase_15 AC 626 ms
10,252 KB
testcase_16 AC 904 ms
10,300 KB
testcase_17 AC 1,473 ms
10,284 KB
testcase_18 AC 1,393 ms
10,284 KB
testcase_19 AC 985 ms
10,268 KB
testcase_20 AC 53 ms
10,160 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
f = math.factorial
s = input()
c = 0
sum = 0
for i in range(len(s)-1, -1, -1):
    if s[i]=='w':
        c += 1
    if s[i]=='c':
        if c>1: sum += (f(c) // f(c-2)) // f(2)
print(sum)
0