結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー letrangerjpletrangerjp
提出日時 2018-04-27 22:47:21
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 11,208 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-09-10 06:36:49
合計ジャッジ時間 3,273 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,260 KB
testcase_01 AC 83 ms
15,084 KB
testcase_02 AC 83 ms
15,344 KB
testcase_03 AC 85 ms
15,080 KB
testcase_04 AC 84 ms
15,340 KB
testcase_05 AC 85 ms
15,180 KB
testcase_06 AC 84 ms
15,260 KB
testcase_07 AC 84 ms
15,272 KB
testcase_08 WA -
testcase_09 AC 84 ms
15,284 KB
testcase_10 AC 86 ms
15,344 KB
testcase_11 AC 85 ms
15,252 KB
testcase_12 AC 84 ms
15,180 KB
testcase_13 AC 84 ms
15,148 KB
testcase_14 AC 84 ms
15,156 KB
testcase_15 WA -
testcase_16 AC 84 ms
15,088 KB
testcase_17 AC 84 ms
15,304 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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
0