結果
| 問題 | No.678 2Dシューティングゲームの必殺ビーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-02-14 15:04:52 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 730 bytes | 
| コンパイル時間 | 854 ms | 
| コンパイル使用メモリ | 88,112 KB | 
| 最終ジャッジ日時 | 2025-01-06 21:09:09 | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 18 | 
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
using namespace std;
int main(){
    int n, lb, rb;
    cin >> n >> lb >> rb;
    vector<tuple<int, int, int, int>> e(n);
    for(int i = 0; i < n; i++){
        int xl, yu, xr, yd;
        cin >> xl >> yu >> xr >> yd;
        e[i] = make_tuple(yd, xl, xr, i);
    }
    sort(rbegin(e), rend(e));
    vector<int> ans(n);
    for(int x = lb; x <= rb; x++){
        for(int i = 0; i < n; i++){
            int xl, xr, id;
            tie(ignore, xl, xr, id) = e[i];
            if(xl <= x && x <= xr){
                ans[id] = 1;
                break;
            }
        }
    }
    for(auto&& i : ans){
        cout << i << endl;
    }
    return 0;
}
            
            
            
        