結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー uafr_csuafr_cs
提出日時 2018-04-27 22:54:34
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,094 bytes
コンパイル時間 2,655 ms
コンパイル使用メモリ 79,464 KB
実行使用メモリ 56,668 KB
最終ジャッジ日時 2023-09-10 06:40:01
合計ジャッジ時間 5,753 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,080 KB
testcase_01 AC 125 ms
55,928 KB
testcase_02 AC 121 ms
55,480 KB
testcase_03 AC 125 ms
56,048 KB
testcase_04 WA -
testcase_05 AC 131 ms
55,924 KB
testcase_06 AC 133 ms
56,028 KB
testcase_07 AC 133 ms
55,784 KB
testcase_08 WA -
testcase_09 AC 134 ms
55,932 KB
testcase_10 AC 144 ms
55,836 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 158 ms
56,036 KB
testcase_14 AC 160 ms
56,104 KB
testcase_15 AC 190 ms
56,668 KB
testcase_16 AC 139 ms
55,648 KB
testcase_17 AC 171 ms
56,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 + 1);
			final int yu = sc.nextInt();
			final int xr = sc.nextInt() + (SIZE + 1);
			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 = xLB + SIZE; x <= xRB + SIZE; 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);
		}
	}
}
0