結果

問題 No.346 チワワ数え上げ問題
ユーザー 👑 KazunKazun
提出日時 2020-06-10 18:32:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 115 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,512 KB
実行使用メモリ 75,660 KB
最終ジャッジ日時 2023-09-05 16:04:18
合計ジャッジ時間 4,049 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,760 KB
testcase_01 AC 76 ms
70,640 KB
testcase_02 AC 78 ms
70,996 KB
testcase_03 AC 76 ms
70,960 KB
testcase_04 AC 77 ms
71,024 KB
testcase_05 AC 76 ms
70,976 KB
testcase_06 AC 77 ms
70,736 KB
testcase_07 AC 78 ms
70,988 KB
testcase_08 AC 76 ms
71,040 KB
testcase_09 AC 78 ms
71,024 KB
testcase_10 AC 84 ms
75,660 KB
testcase_11 AC 82 ms
75,464 KB
testcase_12 AC 84 ms
75,404 KB
testcase_13 AC 82 ms
75,092 KB
testcase_14 AC 81 ms
75,172 KB
testcase_15 AC 84 ms
75,276 KB
testcase_16 AC 86 ms
75,400 KB
testcase_17 AC 83 ms
75,280 KB
testcase_18 AC 83 ms
75,368 KB
testcase_19 AC 82 ms
75,652 KB
testcase_20 AC 81 ms
75,032 KB
testcase_21 AC 82 ms
75,372 KB
testcase_22 AC 82 ms
75,088 KB
testcase_23 AC 77 ms
70,640 KB
testcase_24 AC 77 ms
70,964 KB
testcase_25 AC 75 ms
71,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()

t=0
w=0
for s in S[::-1]:
    if s=="c":
        t+=(w*(w-1))//2
    elif s=="w":
        w+=1
print(t)
0