結果

問題 No.346 チワワ数え上げ問題
ユーザー el_2
提出日時 2020-05-02 22:45:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-01-01 18:01:30
合計ジャッジ時間 2,750 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
cnt_w = 0
total = 0
for i in reversed(range(len(s))):
    if s[i] == "w":
        cnt_w += 1
    elif s[i] == "c":
        total += cnt_w * (cnt_w-1) / 2
print(int(total))
0