結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-20 16:40:50
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 688 bytes
コンパイル時間 2,472 ms
コンパイル使用メモリ 204,480 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 02:29:05
合計ジャッジ時間 2,915 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n,bl,br;
    cin>>n>>bl>>br;
    int colli[1280]{};
    for (int i=bl;i<=br;i++) colli[i]=1;
    pair<int,tuple<int,int,int>> e[n];
    for (int i=0;i<n;i++) {
        int l,u,r,d;
        cin>>l>>u>>r>>d;
        e[i]={d,{l,r,i}};
    }
    sort(e,e+n);
    reverse(e,e+n);
    int hit[n]{};
    for (int i=0;i<n;i++) {
        int l,r,idx;
        tie(l,r,idx)=e[i].second;
        l=max(0,l);
        r=min(1279,r);
        for (int j=max(0,l);j<=r;j++) {
            if (colli[j]) hit[idx]=1;
            colli[j]=0;
        }
    }
    for (int i=0;i<n;i++) cout<<hit[i]<<endl;
    return 0;
}
0