結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー antaanta
提出日時 2018-04-27 22:35:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 916 bytes
コンパイル時間 3,899 ms
コンパイル使用メモリ 168,576 KB
実行使用メモリ 11,700 KB
最終ジャッジ日時 2023-09-10 06:29:01
合計ジャッジ時間 5,465 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
11,440 KB
testcase_01 AC 10 ms
11,496 KB
testcase_02 AC 9 ms
11,608 KB
testcase_03 AC 9 ms
11,524 KB
testcase_04 AC 25 ms
11,556 KB
testcase_05 AC 11 ms
11,512 KB
testcase_06 AC 11 ms
11,512 KB
testcase_07 AC 9 ms
11,576 KB
testcase_08 AC 14 ms
11,612 KB
testcase_09 AC 9 ms
11,608 KB
testcase_10 AC 8 ms
11,540 KB
testcase_11 AC 13 ms
11,512 KB
testcase_12 AC 13 ms
11,484 KB
testcase_13 AC 12 ms
11,480 KB
testcase_14 AC 13 ms
11,484 KB
testcase_15 AC 10 ms
11,524 KB
testcase_16 AC 11 ms
11,580 KB
testcase_17 AC 9 ms
11,700 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; 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