結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-08-20 16:36:53
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 2,398 ms
コンパイル使用メモリ 204,336 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-16 02:28:55
合計ジャッジ時間 3,806 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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;
        for (int j=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