結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー IL_mstaIL_msta
提出日時 2018-04-27 22:45:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 1,651 bytes
コンパイル時間 895 ms
コンパイル使用メモリ 100,896 KB
実行使用メモリ 11,716 KB
最終ジャッジ日時 2023-09-10 06:34:22
合計ジャッジ時間 1,946 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
11,496 KB
testcase_01 AC 9 ms
11,476 KB
testcase_02 AC 10 ms
11,480 KB
testcase_03 AC 9 ms
11,496 KB
testcase_04 AC 26 ms
11,540 KB
testcase_05 AC 11 ms
11,492 KB
testcase_06 AC 11 ms
11,484 KB
testcase_07 AC 9 ms
11,568 KB
testcase_08 AC 14 ms
11,428 KB
testcase_09 AC 9 ms
11,440 KB
testcase_10 AC 9 ms
11,440 KB
testcase_11 AC 14 ms
11,716 KB
testcase_12 AC 14 ms
11,532 KB
testcase_13 AC 12 ms
11,540 KB
testcase_14 AC 13 ms
11,540 KB
testcase_15 AC 11 ms
11,484 KB
testcase_16 AC 11 ms
11,716 KB
testcase_17 AC 9 ms
11,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
#pragma endregion //#include
/////////

#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N;
	cin>> N;
	const int X_MAX = 1280;
	const int Y_MAX = 1680;
	vector< vector<int> > fld(Y_MAX+1,vector<int>(X_MAX+1,0));
	int xLB,xRB;
	cin>>xLB>>xRB;
	for(int i=0;i<N;++i){
		int x0,x1,y0,y1;
		cin>>x0>>y0>>x1>>y1;
		x0 = max(x0,0);
		y0 = max(y0,0);
		x1 = min(x1,X_MAX);
		y1 = min(y1,Y_MAX);
		for(int x=x0;x<=x1;++x){
			for(int y=y0;y<=y1;++y){
				fld[y][x] = i+1;//No
			}
		}
	}
	vector<int> hit(N,0);
	for(int x=xLB;x<=xRB;++x){
		for(int y=Y_MAX;y>=0;--y){
			if( fld[y][x] != 0 ){
				int ter = fld[y][x];
				hit[ter-1] = 1;
				break;
			}
		}
	}
	for(int i=0;i<N;++i){
		cout << hit[i] << endl;
	}
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()
0