結果
問題 | No.678 2Dシューティングゲームの必殺ビーム |
ユーザー | uafr_cs |
提出日時 | 2018-04-27 22:55:58 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 200 ms / 2,000 ms |
コード長 | 1,082 bytes |
コンパイル時間 | 2,196 ms |
コンパイル使用メモリ | 74,796 KB |
実行使用メモリ | 57,652 KB |
最終ジャッジ日時 | 2023-09-10 06:40:30 |
合計ジャッジ時間 | 5,842 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 129 ms
55,568 KB |
testcase_01 | AC | 130 ms
55,712 KB |
testcase_02 | AC | 127 ms
55,976 KB |
testcase_03 | AC | 128 ms
55,996 KB |
testcase_04 | AC | 127 ms
55,808 KB |
testcase_05 | AC | 131 ms
55,868 KB |
testcase_06 | AC | 135 ms
55,836 KB |
testcase_07 | AC | 137 ms
55,820 KB |
testcase_08 | AC | 144 ms
57,652 KB |
testcase_09 | AC | 140 ms
55,888 KB |
testcase_10 | AC | 148 ms
55,760 KB |
testcase_11 | AC | 149 ms
56,024 KB |
testcase_12 | AC | 149 ms
55,712 KB |
testcase_13 | AC | 173 ms
55,860 KB |
testcase_14 | AC | 170 ms
56,036 KB |
testcase_15 | AC | 200 ms
57,140 KB |
testcase_16 | AC | 143 ms
55,832 KB |
testcase_17 | AC | 174 ms
56,112 KB |
ソースコード
import java.math.BigInteger; import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; import java.util.TreeSet; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int xLB = sc.nextInt(); final int xRB = sc.nextInt(); final int SIZE = 1280; int[] low_id = new int[SIZE + 1 + SIZE + SIZE]; int[] low_height = new int[SIZE + 1 + SIZE + SIZE]; Arrays.fill(low_id, -1); Arrays.fill(low_height, Integer.MIN_VALUE); for(int i = 0; i < N; i++) { final int xl = sc.nextInt() + SIZE; final int yu = sc.nextInt(); final int xr = sc.nextInt() + SIZE; final int yd = sc.nextInt(); for(int x = xl; x <= xr; x++) { if(low_height[x] < yd) { low_height[x] = yd; low_id[x] = i; } } } boolean[] hitted = new boolean[N]; for(int x = SIZE + xLB; x <= SIZE + xRB; x++) { if(low_id[x] >= 0) { hitted[low_id[x]] = true; } } for(int i = 0; i < N; i++) { System.out.println(hitted[i] ? 1 : 0); } } }