結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー antaanta
提出日時 2018-04-27 22:34:48
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 920 bytes
コンパイル時間 2,892 ms
コンパイル使用メモリ 168,860 KB
実行使用メモリ 11,736 KB
最終ジャッジ日時 2023-09-10 06:28:37
合計ジャッジ時間 2,662 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
11,420 KB
testcase_01 AC 10 ms
11,528 KB
testcase_02 AC 9 ms
11,496 KB
testcase_03 AC 9 ms
11,492 KB
testcase_04 AC 27 ms
11,428 KB
testcase_05 AC 11 ms
11,580 KB
testcase_06 AC 11 ms
11,516 KB
testcase_07 AC 9 ms
11,736 KB
testcase_08 AC 15 ms
11,576 KB
testcase_09 AC 9 ms
11,536 KB
testcase_10 AC 9 ms
11,596 KB
testcase_11 AC 14 ms
11,592 KB
testcase_12 AC 13 ms
11,424 KB
testcase_13 AC 12 ms
11,596 KB
testcase_14 AC 13 ms
11,420 KB
testcase_15 AC 11 ms
11,496 KB
testcase_16 AC 11 ms
11,520 KB
testcase_17 AC 10 ms
11,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
template<typename T, typename U> static void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if (x < y) x = y; }

using namespace std;

int main() {
	int N;
	while (~scanf("%d", &N)) {
		const int H = 1680, W = 1280;
		int L; int R;
		scanf("%d%d", &L, &R);
		vector<vector<int>> id(H + 1, vector<int>(W + 1, -1));
		for (int i = 0; i < N; ++ i) {
			int xL; int yL; int xR; int yR;
			scanf("%d%d%d%d", &xL, &yL, &xR, &yR);
			amax(xL, 0);
			amin(xR, W);
			amax(yL, 0);
			amin(yR, H);
			for (int x = xL; x <= xR; ++ x)
				for (int y = yL; y <= yR; ++ y)
					id[y][x] = i;
		}
		vector<int> ans(N, 0);
		for (int x = L; x <= R; ++ x) {
			for (int y = H - 1; y >= 0; -- y) {
				int i = id[y][x];
				if (i != -1) {
					ans[i] = 1;
					break;
				}
			}
		}
		for (int i = 0; i < (int)ans.size(); ++ i)
			printf("%d\n", ans[i]);
	}
}
0