結果

問題 No.346 チワワ数え上げ問題
ユーザー yuki2006yuki2006
提出日時 2016-02-26 02:16:19
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 307 bytes
コンパイル時間 10,877 ms
コンパイル使用メモリ 220,948 KB
実行使用メモリ 13,896 KB
最終ジャッジ日時 2024-04-19 06:12:55
合計ジャッジ時間 16,116 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,288 KB
testcase_01 AC 2 ms
6,812 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 248 ms
6,940 KB
testcase_11 AC 110 ms
6,940 KB
testcase_12 AC 168 ms
6,940 KB
testcase_13 AC 93 ms
6,944 KB
testcase_14 AC 6 ms
6,944 KB
testcase_15 AC 149 ms
6,944 KB
testcase_16 AC 182 ms
6,940 KB
testcase_17 AC 240 ms
6,944 KB
testcase_18 AC 243 ms
6,940 KB
testcase_19 AC 194 ms
6,940 KB
testcase_20 TLE -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import "fmt"

func main() {
	var s string
	fmt.Scanf("%s", &s)
	total := 0
	for i := 0; i < len(s); i++ {
		if s[i] == 'c' {
			countW := 0
			for j := i + 1; j < len(s); j++ {
				if s[j] == 'w' {
					countW += 1
				}
			}
			total += countW * (countW - 1) / 2
		}
	}
	fmt.Println(total)
}
0