結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー firiexpfiriexp
提出日時 2019-03-28 20:35:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,028 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 83,072 KB
最終ジャッジ日時 2023-08-09 21:11:03
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:26:27: エラー: 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};
      |                           ^
次のファイルから読み込み:  /usr/local/gcc7/include/c++/12.2.0/bits/stl_map.h:63,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/map:61,
         次から読み込み:  main.cpp:5:
/usr/local/gcc7/include/c++/12.2.0/tuple:1595:45: 備考: 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: エラー: 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: エラー: 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: エラー: 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: エラー: 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>’

ソースコード

diff #

#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;
}
0