結果

問題 No.346 チワワ数え上げ問題
ユーザー B9syDOfYhHFXecu
提出日時 2018-11-03 23:15:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-20 19:38:42
合計ジャッジ時間 1,970 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #


s = input()[::-1]
count_w = 0
count = 0

for i in s:
    if i == 'w':
        count_w += 1
    
    if i == 'c':
        count += count_w * (count_w - 1) // 2

print(count)
0