結果

問題 No.346 チワワ数え上げ問題
ユーザー rlangevinrlangevin
提出日時 2023-01-06 00:09:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 140 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 75,752 KB
最終ジャッジ日時 2023-08-19 20:48:36
合計ジャッジ時間 4,276 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,264 KB
testcase_01 AC 65 ms
71,212 KB
testcase_02 AC 63 ms
71,012 KB
testcase_03 AC 62 ms
71,356 KB
testcase_04 AC 61 ms
71,092 KB
testcase_05 AC 61 ms
71,292 KB
testcase_06 AC 61 ms
71,020 KB
testcase_07 AC 62 ms
71,092 KB
testcase_08 AC 64 ms
71,232 KB
testcase_09 AC 65 ms
71,100 KB
testcase_10 AC 91 ms
75,560 KB
testcase_11 AC 70 ms
75,560 KB
testcase_12 AC 69 ms
75,544 KB
testcase_13 AC 68 ms
75,548 KB
testcase_14 AC 67 ms
75,636 KB
testcase_15 AC 67 ms
75,548 KB
testcase_16 AC 69 ms
75,752 KB
testcase_17 AC 68 ms
75,412 KB
testcase_18 AC 71 ms
75,692 KB
testcase_19 AC 73 ms
75,604 KB
testcase_20 AC 68 ms
75,340 KB
testcase_21 AC 67 ms
75,644 KB
testcase_22 AC 67 ms
75,612 KB
testcase_23 AC 61 ms
71,128 KB
testcase_24 AC 62 ms
71,060 KB
testcase_25 AC 64 ms
71,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
c, cw, ans = 0, 0, 0
for s in S:
    if s == "c":
        c += 1
    elif s == "w":
        ans += cw
        cw += c
print(ans)
0