結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,024 KB
testcase_01 AC 29 ms
10,024 KB
testcase_02 AC 29 ms
10,024 KB
testcase_03 AC 29 ms
10,024 KB
testcase_04 AC 30 ms
10,024 KB
testcase_05 AC 30 ms
10,024 KB
testcase_06 AC 29 ms
10,024 KB
testcase_07 AC 29 ms
10,024 KB
testcase_08 AC 29 ms
10,024 KB
testcase_09 AC 30 ms
10,024 KB
testcase_10 AC 1,960 ms
10,392 KB
testcase_11 AC 545 ms
10,268 KB
testcase_12 AC 1,050 ms
10,348 KB
testcase_13 AC 386 ms
10,224 KB
testcase_14 AC 31 ms
10,036 KB
testcase_15 AC 911 ms
10,316 KB
testcase_16 AC 1,280 ms
10,360 KB
testcase_17 AC 1,997 ms
10,392 KB
testcase_18 AC 1,907 ms
10,392 KB
testcase_19 AC 1,388 ms
10,364 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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