結果
問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
ユーザー |
![]() |
提出日時 | 2018-08-13 01:34:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,216 bytes |
コンパイル時間 | 1,020 ms |
コンパイル使用メモリ | 104,420 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 07:39:25 |
合計ジャッジ時間 | 1,661 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <unordered_map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; int main() { int N,xLB,xRB; cin >> N >> xLB >> xRB; int X[1281] = {0}; for ( int i = xLB; i <= xRB; i++ ) { X[i] = 1; } vector< pair< pair< int, pair<int, int> >, int > > V(N); for ( int i = 0; i < N; i++ ) { int a,b,c,d; cin >> a >> b >> c >> d; a = max(a,0); c = min(c,1280); V[i] = make_pair( make_pair( d, make_pair(a,c) ), i ); } sort( V.begin(), V.end(), greater< pair< pair< int, pair<int, int> >, int > >() ); vector<int> ans(N); for ( int i = 0; i < N; i++ ) { bool death = false; for ( int j = V[i].first.second.first; j <= V[i].first.second.second; j++ ) { if ( X[j] == 1 ) { death = true; } X[j] = 0; } ans[ V[i].second ] = death ? 1 : 0; } for ( int i = 0; i < N; i++ ) { cout << ans[i] << endl; } return 0; }