結果
問題 |
No.346 チワワ数え上げ問題
|
ユーザー |
|
提出日時 | 2016-02-26 02:16:19 |
言語 | Go (1.23.4) |
結果 |
TLE
|
実行時間 | - |
コード長 | 307 bytes |
コンパイル時間 | 11,195 ms |
コンパイル使用メモリ | 231,808 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-10 22:52:30 |
合計ジャッジ時間 | 16,996 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 20 TLE * 1 -- * 2 |
ソースコード
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) }