結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー 37zigen37zigen
提出日時 2020-03-21 18:40:00
言語 Java19
(openjdk 21)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 1,296 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 74,780 KB
実行使用メモリ 69,752 KB
最終ジャッジ日時 2023-08-24 21:39:35
合計ジャッジ時間 7,925 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 208 ms
69,004 KB
testcase_01 AC 206 ms
68,984 KB
testcase_02 AC 231 ms
68,912 KB
testcase_03 AC 232 ms
68,548 KB
testcase_04 AC 212 ms
68,552 KB
testcase_05 AC 238 ms
68,912 KB
testcase_06 AC 240 ms
69,056 KB
testcase_07 AC 243 ms
67,132 KB
testcase_08 AC 245 ms
69,752 KB
testcase_09 AC 238 ms
69,508 KB
testcase_10 AC 250 ms
69,428 KB
testcase_11 AC 233 ms
69,256 KB
testcase_12 AC 231 ms
69,028 KB
testcase_13 AC 270 ms
69,396 KB
testcase_14 AC 270 ms
69,160 KB
testcase_15 AC 302 ms
69,420 KB
testcase_16 AC 247 ms
68,964 KB
testcase_17 AC 259 ms
69,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		long t = System.currentTimeMillis();
		new Main().run();
		System.err.println(System.currentTimeMillis() - t);
	}
	
	Scanner sc = new Scanner(System.in);
	
	void run() {
		int N=sc.nextInt();
		int L=sc.nextInt();
		int R=sc.nextInt();
		int[][] map=new int[2700][1300];
		for(int i=0;i<map.length;++i)for(int j=0;j<map[i].length;++j)map[i][j]=-1;
		for(int n=0;n<N;++n) {
			int xl=Math.max(L,sc.nextInt());
			int yu=sc.nextInt()+501;
			int xr=Math.min(R,sc.nextInt());
			int yd=sc.nextInt()+501;
			for(int x=xl;x<=xr;++x) {
				for(int y=yu;y<=yd;++y) {
					if(map[y][x]!=-1)throw new AssertionError();
					map[y][x]=n;
				}
			}
		}
		boolean[] hit=new boolean[N];
		for(int i=0;i<map[map.length-1].length;++i)map[map.length-1][i]=-2;
		for(int h=map.length-2;h>=0;--h) {
			for(int w=0;w<map[h].length;++w) {
				if(map[h+1][w]!=-2)continue;
				if(map[h][w]==-1) {
					map[h][w]=-2;
				}else {
					hit[map[h][w]]=true;
				}
			}
		}
		for(int i=0;i<N;++i) {
			System.out.println(hit[i]?1:0);
		}
	}


	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0