結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー Mcpu3Mcpu3
提出日時 2018-12-08 10:04:13
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 784 bytes
コンパイル時間 1,386 ms
コンパイル使用メモリ 28,856 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 04:54:33
合計ジャッジ時間 2,486 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 0 ms
4,352 KB
testcase_03 AC 0 ms
4,348 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>

typedef struct {
	int XL, XR, YD;
} enemy;

int compare(const void *x, const void *y)
{
	return ((enemy*)y)->YD - ((enemy*)x)->YD;
}

int main(void)
{
	int N, xLB, xRB, width[1280] = {}, i, j;
	enemy hitJudge[188];
	scanf("%d%d%d", &N, &xLB, &xRB);
	for (i = xLB; i <= xRB; ++i) width[i - 1] = 1;
	for (i = 0; i < N; ++i) scanf("%d%*d%d%d", &hitJudge[i].XL, &hitJudge[i].XR, &hitJudge[i].YD);
	qsort(hitJudge, N, sizeof(enemy), compare);
	for (i = 0; i < N; ++i) {
		for (j = hitJudge[i].XL; j <= hitJudge[i].XR; ++j) {
			if (width[j - 1] == 1) break;
		}
		if (j != hitJudge[i].XR + 1) {
			for (j = hitJudge[i].XL; j <= hitJudge[i].XR; ++j) width[j - 1] = 0;
			puts("1");
		}
		else puts("0");
	}
	return 0;
}
0