結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 29 ms
10,092 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 30 ms
10,092 KB
testcase_09 AC 29 ms
10,092 KB
testcase_10 RE -
testcase_11 AC 548 ms
10,336 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 30 ms
10,104 KB
testcase_15 AC 918 ms
10,384 KB
testcase_16 AC 1,286 ms
10,428 KB
testcase_17 RE -
testcase_18 AC 1,907 ms
10,460 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 TLE -
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'])
        sum += (f(n) // f(n-2)) // f(2)
print(sum)
0