結果

問題 No.346 チワワ数え上げ問題
ユーザー JunOnuma
提出日時 2017-06-06 18:14:08
言語 Python2
(2.7.18)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 161 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-09-22 11:48:46
合計ジャッジ時間 2,339 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

l = list(raw_input())
l.reverse()
cnt = 0
w = 0
for c in l:
    if c == 'w':
        w += 1
    elif c == 'c' and w >= 2:
        cnt += w * (w-1) / 2
print cnt
0