結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー hkrhkr
提出日時 2018-04-27 23:20:39
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 880 bytes
コンパイル時間 1,380 ms
コンパイル使用メモリ 156,276 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 06:48:56
合計ジャッジ時間 2,432 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N, LB, RB;
  cin >> N >> LB >> RB;
  vector<ll> XL(N), YU(N), XR(N), YD(N);
  vector< pair<int, int> > vp(N);
  vector<bool> used(1300, false);

  for(int i=0;i<N;i++) {
    cin >> XL[i] >> YU[i] >> XR[i] >> YD[i];
    vp[i] = make_pair(YD[i], i);
  }

  sort(vp.begin(), vp.end(), greater<pair<int, int> >());
  vector<int> ans(N);
  for(int i=0;i<N;i++) {
    int idx = vp[i].second;
    if(XL[idx] >= RB || XR[idx] <= LB) {
      ans[idx] = 0;
      continue;
    }

    bool flag = false;
    for(int x=max<ll>(LB, XL[idx]);x<=min<ll>(XR[idx], RB);x++) {
      if(!used[x])
        flag = true;
      used[x] = true;
    }
    if(flag)
      ans[idx] = 1;
    else
      ans[idx] = 0;
  }
  for(int i=0;i<N;i++)
    cout << ans[i] << endl;


}
0