結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー tetsuzuki1115tetsuzuki1115
提出日時 2018-08-13 01:34:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,216 bytes
コンパイル時間 1,045 ms
コンパイル使用メモリ 104,356 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 16:26:04
合計ジャッジ時間 1,814 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
}
0