結果

問題 No.346 チワワ数え上げ問題
ユーザー norioc
提出日時 2022-04-07 02:37:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 159 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-27 21:42:44
合計ジャッジ時間 2,405 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import comb

S = input()
w = 0
ans = 0
for c in reversed(S):
    if c == 'w':
        w += 1
    elif c == 'c':
        ans += comb(w, 2)
print(ans)
0