結果
問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
ユーザー |
|
提出日時 | 2018-04-27 22:47:21 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 63 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-06-27 22:05:17 |
合計ジャッジ時間 | 2,450 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 2 |
コンパイルメッセージ
Syntax OK
ソースコード
N, xLB, xRB = gets.split.map &:to_i enemies = $<.map.with_index{|s, i| [i] + s.split.map(&:to_i) }.sort_by{|i, xl, yu, xr, yd| -yd } beam = [false] * 1281 (xLB..xRB).each{|x| beam[x] = true } ans = [0] * N enemies.each{|i, xl, yu, xr, yd| hit = false (xl..xr).each{|x| if beam[x] hit = true beam[x] = false end } ans[i] = 1 if hit } puts ans