結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-09 01:22:23 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 119 ms / 2,000 ms |
| コード長 | 160 bytes |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 17,280 KB |
| 最終ジャッジ日時 | 2024-09-24 16:10:55 |
| 合計ジャッジ時間 | 3,323 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
コンパイルメッセージ
Syntax OK
ソースコード
sum = 0
ans = 0
s = gets.chomp.split('c').map{|a|a.count('w')}.reverse
(s.size - 1).times{|i|
sum += s[i]
ans += sum * (sum - 1) / 2
}
p ans