結果

問題 No.346 チワワ数え上げ問題
ユーザー yumechi
提出日時 2016-03-08 22:19:05
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 405 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 73,372 KB
最終ジャッジ日時 2024-09-24 15:43:36
合計ジャッジ時間 6,515 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    s = input()
    cl = []
    wc, cllen = 0, 0
    
    for c in s:
        if c == "c":
            cl.append(0)
            cllen += 1
            continue
        if c == "w":
            for i in range(cllen):
                cl[i] += 1
    res = 0
    for i in cl:
        if i < 2:
            break
        res += i * (i - 1) // 2
    print(res)

if __name__=="__main__":
    solve()
0