結果
問題 | No.154 市バス |
ユーザー |
|
提出日時 | 2016-10-18 11:36:55 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 422 bytes |
コンパイル時間 | 281 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 13,568 KB |
最終ジャッジ日時 | 2024-10-13 08:45:53 |
合計ジャッジ時間 | 3,277 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 4 WA * 4 |
コンパイルメッセージ
Syntax OK
ソースコード
ws = 0gs = 0gets.to_i.times dopossible = truegets.chomp.chars.each do |c|case cwhen "W"ws += 1when "G"if ws <= 0possible = falsebreakendws -= 1gs += 1when "R"if gs <= 0possible = falsebreakendgs -= 1endendif possible && gs.zero?puts "possible"elseputs "impossible"endend