結果
問題 | No.678 2Dシューティングゲームの必殺ビーム |
ユーザー | YamaKasa |
提出日時 | 2018-10-01 15:16:39 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 219 ms / 2,000 ms |
コード長 | 896 bytes |
コンパイル時間 | 2,092 ms |
コンパイル使用メモリ | 76,892 KB |
実行使用メモリ | 53,428 KB |
最終ジャッジ日時 | 2024-04-20 14:16:41 |
合計ジャッジ時間 | 5,907 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 148 ms
52,444 KB |
testcase_01 | AC | 147 ms
52,376 KB |
testcase_02 | AC | 142 ms
52,232 KB |
testcase_03 | AC | 143 ms
52,044 KB |
testcase_04 | AC | 152 ms
52,480 KB |
testcase_05 | AC | 148 ms
52,628 KB |
testcase_06 | AC | 156 ms
52,648 KB |
testcase_07 | AC | 160 ms
52,588 KB |
testcase_08 | AC | 162 ms
52,148 KB |
testcase_09 | AC | 164 ms
52,208 KB |
testcase_10 | AC | 168 ms
52,700 KB |
testcase_11 | AC | 165 ms
52,280 KB |
testcase_12 | AC | 168 ms
52,744 KB |
testcase_13 | AC | 186 ms
52,556 KB |
testcase_14 | AC | 199 ms
52,804 KB |
testcase_15 | AC | 219 ms
53,428 KB |
testcase_16 | AC | 161 ms
52,376 KB |
testcase_17 | AC | 208 ms
52,716 KB |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[][]d = new int[1681][1281]; int N = scan.nextInt(); int xLB = scan.nextInt(); int xRB = scan.nextInt(); for(int i = 0; i < N; i++) { int XL = scan.nextInt(); int YU = scan.nextInt(); int XR = scan.nextInt(); int YD = scan.nextInt(); int id = i + 1; int wMin = Math.max(0, XL); int hMin = Math.max(0, YU); int wMax = Math.min(1280, XR); int hMax = Math.min(1680, YD); for(int h = hMin; h <= hMax; h++) { for(int w = wMin; w <= wMax; w++) { d[h][w] = id; } } } scan.close(); int[]ans = new int[N]; for(int i = xLB; i <= xRB; i++) { for(int j = 1680; j >= 0; j--) { if(d[j][i] != 0) { ans[d[j][i] - 1] = 1; break; } } } for(int i : ans) { System.out.println(i); } } }