結果

問題 No.346 チワワ数え上げ問題
ユーザー mesame3993mesame3993
提出日時 2021-09-16 08:19:43
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 148 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 90,596 KB
最終ジャッジ日時 2023-09-12 00:54:44
合計ジャッジ時間 8,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,292 KB
testcase_01 AC 69 ms
71,252 KB
testcase_02 AC 68 ms
71,440 KB
testcase_03 AC 70 ms
71,380 KB
testcase_04 AC 72 ms
71,436 KB
testcase_05 AC 70 ms
71,444 KB
testcase_06 AC 68 ms
71,252 KB
testcase_07 AC 67 ms
71,364 KB
testcase_08 AC 69 ms
71,444 KB
testcase_09 AC 68 ms
71,280 KB
testcase_10 AC 156 ms
77,292 KB
testcase_11 AC 104 ms
76,704 KB
testcase_12 AC 124 ms
76,856 KB
testcase_13 AC 97 ms
76,692 KB
testcase_14 AC 72 ms
75,792 KB
testcase_15 AC 121 ms
76,976 KB
testcase_16 AC 136 ms
77,120 KB
testcase_17 AC 162 ms
77,204 KB
testcase_18 AC 161 ms
77,248 KB
testcase_19 AC 141 ms
77,076 KB
testcase_20 TLE -
testcase_21 AC 1,259 ms
83,532 KB
testcase_22 AC 1,218 ms
83,644 KB
testcase_23 AC 70 ms
71,336 KB
testcase_24 AC 71 ms
71,652 KB
testcase_25 AC 70 ms
71,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
n = len(s)
ans = 0
for i in range(n):
	if s[i] == 'c':
		tmp = s[i:]
		w = tmp.count('w')
		if w >= 2:
			ans += w*(w-1) // 2
print(ans)
0