結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
urutom
|
| 提出日時 | 2019-04-03 19:33:09 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 1,418 ms / 2,000 ms |
| コード長 | 184 bytes |
| コンパイル時間 | 196 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-11-18 13:38:58 |
| 合計ジャッジ時間 | 10,164 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
n=gets.to_i
s=gets.chomp
ans=0
0.upto(n-3){|i|
next unless s[i]==?U
(i+2).upto(n-1){|k|
next unless s[k]==?G
next if (i+k).odd?
ans+=1 if s[(i+k)/2]==?M
}
}
puts ans
urutom