結果

問題 No.346 チワワ数え上げ問題
ユーザー mesame3993mesame3993
提出日時 2021-09-16 08:19:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 148 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 8,380 KB
最終ジャッジ日時 2023-09-12 00:53:44
合計ジャッジ時間 8,740 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,860 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 16 ms
7,916 KB
testcase_03 AC 16 ms
7,920 KB
testcase_04 AC 16 ms
7,836 KB
testcase_05 AC 15 ms
7,848 KB
testcase_06 AC 15 ms
7,804 KB
testcase_07 AC 15 ms
7,964 KB
testcase_08 AC 16 ms
7,868 KB
testcase_09 AC 15 ms
7,848 KB
testcase_10 AC 231 ms
8,284 KB
testcase_11 AC 93 ms
8,172 KB
testcase_12 AC 146 ms
8,372 KB
testcase_13 AC 75 ms
8,040 KB
testcase_14 AC 15 ms
7,808 KB
testcase_15 AC 132 ms
8,148 KB
testcase_16 AC 168 ms
8,380 KB
testcase_17 AC 227 ms
8,280 KB
testcase_18 AC 223 ms
8,220 KB
testcase_19 AC 176 ms
8,196 KB
testcase_20 TLE -
testcase_21 AC 1,740 ms
8,160 KB
testcase_22 AC 1,739 ms
8,352 KB
testcase_23 AC 16 ms
7,840 KB
testcase_24 AC 16 ms
7,788 KB
testcase_25 AC 16 ms
7,820 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