結果

問題 No.346 チワワ数え上げ問題
コンテスト
ユーザー ebicochineal
提出日時 2016-03-12 22:26:09
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 225 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 328 ms
コンパイル使用メモリ 20,828 KB
実行使用メモリ 23,384 KB
最終ジャッジ日時 2026-04-12 15:43:34
合計ジャッジ時間 16,494 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 8 RE * 13 TLE * 1 -- * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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