結果
| 問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-28 20:35:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,028 bytes |
| コンパイル時間 | 645 ms |
| コンパイル使用メモリ | 83,092 KB |
| 最終ジャッジ日時 | 2024-11-14 21:21:37 |
| 合計ジャッジ時間 | 1,028 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:26:27: error: invalid use of incomplete type '__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 4> >, std::array<int, 4> >::value_type' {aka 'struct std::array<int, 4>'}
26 | v[i] = {a, b, c, d};
| ^
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_map.h:63,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/map:61,
from main.cpp:5:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/tuple:1595:45: note: declaration of '__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 4> >, std::array<int, 4> >::value_type' {aka 'struct std::array<int, 4>'}
1595 | template<typename _Tp, size_t _Nm> struct array;
| ^~~~~
main.cpp:32:20: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 4> >, std::array<int, 4> >::value_type' {aka 'std::array<int, 4>'} and 'int')
32 | if(v[i][0] <= x && x <= v[i][2]) {
| ^
main.cpp:32:41: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 4> >, std::array<int, 4> >::value_type' {aka 'std::array<int, 4>'} and 'int')
32 | if(v[i][0] <= x && x <= v[i][2]) {
| ^
main.cpp:33:28: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 4> >, std::array<int, 4> >::value_type' {aka 'std::array<int, 4>'} and 'int')
33 | if(M < v[i][3]){
| ^
main.cpp:34:29: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::array<int, 4> >, std::array<int, 4> >::value_type' {aka 'std::array<int, 4>'} and 'int')
34 | M = v[i][3]; c
ソースコード
#include <limits>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
static const int MOD = 1000000007;
using ll = int64_t;
using u32 = uint32_t;
using namespace std;
template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;
int main() {
int n, xl, xr;
cin >> n >> xl >> xr;
vector<array<int, 4>> v(n);
for (int i = 0; i < n; ++i) {
int a, b, c, d;
scanf("%d %d %d %d", &a, &b, &c, &d);
v[i] = {a, b, c, d};
}
vector<int> ans(n);
for (int x = xl; x <= xr; ++x) {
int M = -INF<int>, c = -1;
for (int i = 0; i < n; ++i) {
if(v[i][0] <= x && x <= v[i][2]) {
if(M < v[i][3]){
M = v[i][3]; c = i;
}
}
}
if(c != -1){
ans[c] = 1;
}
}
for (int i = 0; i < n; ++i) {
cout << ans[i] << "\n";
}
return 0;
}