結果
| 問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-04-27 22:40:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,374 bytes |
| コンパイル時間 | 2,100 ms |
| コンパイル使用メモリ | 198,236 KB |
| 最終ジャッジ日時 | 2025-01-05 10:24:28 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
#define show(x) cerr << #x << " = " << x << endl
using namespace std;
using ll = long long;
using ld = long double;
constexpr ll MOD = 1000000007LL;
template <typename T>
constexpr T INF = numeric_limits<T>::max() / 10;
template <typename Functor>
struct fix_type
{
Functor functor;
template <typename... Args>
decltype(auto) operator()(Args&&... args) const& { return functor(functor, std::forward<Args>(args)...); }
};
template <typename Functor>
fix_type<typename std::decay<Functor>::type> fix(Functor&& functor) { return {std::forward<Functor>(functor)}; }
struct Ship
{
int xl;
int xr;
int yd;
int yu;
};
int main()
{
int N;
cin >> N;
int L, R;
cin >> L >> R;
vector<Ship> ship(N);
for (int i = 0; i < N; i++) {
Ship& s = ship[i];
cin >> s.xl >> s.yu >> s.xr >> s.yd;
}
vector<bool> hit(N, false);
for (int x = L; x <= R; x++) {
int minind = -1;
int Y = -501;
for (int i = 0; i < N; i++) {
if (ship[i].xl <= x and x <= ship[i].xr) {
if (Y < ship[i].yd) {
Y = ship[i].yd;
minind = i;
}
}
}
if (minind != -1) { hit[minind] = true; }
}
for (int i = 0; i < N; i++) {
cout << hit[i] << endl;
}
return 0;
}