結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー simansiman
提出日時 2022-10-24 14:39:17
言語 Ruby
(3.3.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 11,416 KB
実行使用メモリ 15,292 KB
最終ジャッジ日時 2023-09-15 14:21:49
合計ジャッジ時間 2,658 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,248 KB
testcase_01 AC 88 ms
15,072 KB
testcase_02 AC 87 ms
15,160 KB
testcase_03 AC 88 ms
15,140 KB
testcase_04 AC 88 ms
15,140 KB
testcase_05 AC 87 ms
15,276 KB
testcase_06 AC 88 ms
15,292 KB
testcase_07 AC 88 ms
15,040 KB
testcase_08 AC 87 ms
15,136 KB
testcase_09 AC 87 ms
15,144 KB
testcase_10 AC 88 ms
15,040 KB
testcase_11 AC 88 ms
15,112 KB
testcase_12 AC 87 ms
15,292 KB
testcase_13 AC 88 ms
15,036 KB
testcase_14 AC 88 ms
15,032 KB
testcase_15 AC 89 ms
15,152 KB
testcase_16 AC 84 ms
15,256 KB
testcase_17 AC 84 ms
15,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, LB, RB = gets.split.map(&:to_i)
P = N.times.map { |i|
  [i] + gets.split.map(&:to_i)
}

P.sort_by! { |_, _, yu, _, _| -yu }
ans = Array.new(N, false)

covered = Hash.new(false)

P.each do |i, xl, yu, xr, yd|
  hit = false

  [xl, LB].max.upto([xr, RB].min) do |x|
    hit |= !covered[x]
    covered[x] = true
  end

  ans[i] = hit
end

puts ans.map { |f| f ? 1 : 0 }
0