結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー wk1080idwk1080id
提出日時 2019-01-14 02:53:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 1,745 bytes
コンパイル時間 1,170 ms
コンパイル使用メモリ 84,316 KB
実行使用メモリ 73,848 KB
最終ジャッジ日時 2023-08-28 17:22:00
合計ジャッジ時間 5,413 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 227 ms
73,656 KB
testcase_01 AC 224 ms
73,576 KB
testcase_02 AC 226 ms
73,652 KB
testcase_03 AC 224 ms
73,564 KB
testcase_04 AC 232 ms
73,724 KB
testcase_05 AC 212 ms
73,564 KB
testcase_06 AC 196 ms
73,636 KB
testcase_07 AC 196 ms
73,580 KB
testcase_08 AC 183 ms
73,848 KB
testcase_09 AC 185 ms
73,580 KB
testcase_10 AC 182 ms
73,644 KB
testcase_11 AC 179 ms
73,712 KB
testcase_12 AC 178 ms
73,660 KB
testcase_13 AC 180 ms
73,576 KB
testcase_14 AC 181 ms
73,580 KB
testcase_15 AC 178 ms
73,736 KB
testcase_16 AC 187 ms
73,652 KB
testcase_17 AC 180 ms
73,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a*b/gcd(a,b);
}

int g[3000][3000] = {};

signed main(void) {
    int n;
    cin >> n;
    int l,r;
    cin >> l >> r;
    l += 600;
    r += 600;
    g[2999][l]--;
    g[2999][r+1]++;
    rep(i,n){
        int xl,yu,xr,yd;
        cin >> xl >> yu >> xr >> yd;
        xl += 600;
        yu += 600;
        xr += 600;
        yd += 600;
        xr++;
        yd++;
        g[yu][xl] += i+1;
        g[yd][xl] -= i+1;
        g[yu][xr] -= i+1;
        g[yd][xr] += i+1;
    }
    rep(i,3000)rep(j,3000-1)g[i][j+1] += g[i][j];
    rep(j,3000)rep(i,3000-1)g[i+1][j] += g[i][j];
    vi ans(n,0);
    for(int i = 2998; i >= 0; i--)for(int j = 2999; j >= 0; j--)if(g[i+1][j] == -1){
        if(g[i][j]){
            ans[g[i][j]-1]++;
        }else{
            g[i][j] = -1;
        }
    }
    rep(i,n){
        if(ans[i])cout << 1 << endl;
        else cout << 0 << endl;
    }
}
0