結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー ミドリムシミドリムシ
提出日時 2018-04-27 22:43:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,203 bytes
コンパイル時間 983 ms
コンパイル使用メモリ 74,796 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-10 06:33:27
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

#define YES(condition) if(condition) cout << "YES" << endl; else cout << "NO" << endl
#define Yes(condition) if(condition) cout << "Yes" << endl; else cout << "No" << endl
#define POSS(condition) if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl
#define Poss(condition) if(condition)cout << "Possible" << endl; else cout << "Impossible" << endl
#define First(condition) if(condition)cout << "First" << endl; else cout << "Second" << endl
#define negative(condition, num) if(condition)cout << -1 << endl; else cout << num << endl
long power(long base, long exponent, long mod){ if(exponent % 2){ return power(base, exponent - 1, mod) * base % mod; }else if(exponent){ long root_ans = power(base, exponent / 2, mod); return root_ans * root_ans % mod; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define division long(1e9 + 7)
#define all(x) (x).begin(), (x).end()

struct enemy{
    int L, U, R, D;
    
    bool operator >(const enemy& another) const{
        return D > another.D;
    }
};

int main(){
    int N, xL, xR;
    cin >> N >> xL >> xR;
    enemy enemies[N];
    for(int i = 0; i < N; i++){
        cin >> enemies[i].L >> enemies[i].U >> enemies[i].R >> enemies[i].D;
        enemies[i].L = max(enemies[i].L, 1);
        enemies[i].R = min(enemies[i].R, 1280);
        enemies[i].U = max(enemies[i].U, 1);
        enemies[i].D = min(enemies[i].D, 1680);
    }
    sort(enemies, enemies + N, greater<enemy>());
    vector<bool> if_out(N, false);
    for(int i = xL; i <= xR; i++){
        for(int j = 0; j < N; j++){
            if(enemies[j].L <= i && i <= enemies[j].R){
                if_out[j] = true;
                break;
            }
        }
    }
    for(int i = 0; i < N; i++){
        cout << if_out[i] << endl;
    }
}
0