結果
| 問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-04-27 23:05:51 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 783 bytes |
| コンパイル時間 | 1,664 ms |
| コンパイル使用メモリ | 171,536 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 22:11:27 |
| 合計ジャッジ時間 | 2,374 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool used[2000], ans[200];
int xl[200], yu[200], xr[200], yd[200];
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int n, xlb, xrb;
cin >> n >> xlb >> xrb;
vector<int> idxs(n);
for (int i = 0; i < n; i++) {
cin >> xl[i] >> yu[i] >> xr[i] >> yd[i];
idxs[i] = i;
}
sort(idxs.begin(), idxs.end(), [&](const int& i1, const int& i2){return yd[i1] > yd[i2];});
for (int i : idxs) {
for (int j = max(xl[i], xlb); j <= min(xr[i], xrb); j++) {
if (!used[j]) {
ans[i] = true;
used[j] = true;
}
}
}
for (int i = 0; i < n; i++) {
cout << ans[i] << endl;
}
return 0;
}