結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー dazydazy
提出日時 2018-05-03 03:53:21
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 958 bytes
コンパイル時間 1,078 ms
コンパイル使用メモリ 143,892 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-10 09:11:07
合計ジャッジ時間 1,972 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
#define fastcin {\
    cin.tie(0);\
    ios::sync_with_stdio(false);\
}
using namespace std;

int main() {
    fastcin;

    int N, LB, RB;
    int f[1281];
    int a[1281];
    for(int i = 0; i < 1281; i++) {
        f[i] = a[i] = -1;
    }
    cin >> N >> LB >> RB;

    for(int i = 0; i < N; i++) {
        int XL, YU, XR, YD;
        cin >> XL >> YU >> XR >> YD;
        if(XL < 0) XL = 0;
        if(XR > 1280) XR = 1280;
        if(YD > 1680) YD = 1680;
        for(int j = XL; j <= XR; j++) {
            if(f[j] < YD) {
                f[j] = YD;
                a[j] = i;
            }
        }
    }

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < 1281; j++) {
            if(j >= LB && j <= RB) {
                if(a[j] == i) {
                     cout << "1" << "\n";
                    break;
                }
            }
            if(j == 1280) cout << "0" << "\n";
        }
    }
    return 0;
}
0