제출 #946089

#제출 시각아이디문제언어결과실행 시간메모리
946089itslq새 집 (APIO18_new_home)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

int main() {
    int N, K, Q, L, Y;
    cin >> N >> K >> Q;

    vector<int> X(N), T(N), A(N), B(N);
    for (int i = 0; i < N; i++) cin >> X[i] >> T[i] >> A[i] >> B[i];

    unordered<set> types;
    for (int i = 0; i < N; i++) types.insert(T[i]);

    while (Q--) {
        cin >> L >> Y;

        unordered_map<int, int> stores;

        for (int i = 0; i < N; i++) {
            if (A[i] <= Y && Y <= B[i]) {
                stores[T[i]] = max(abs(L - X[i]), stores[T[i]]);
            }
        }

        if (stores.size() < types.size()) {
            cout << "-1\n";
            continue;
        }

        int M = -1;
        for (pair<int, int> x: stores) {
            M = max(M, x.second);
        }

        cout << M << '\n';
    }
}

컴파일 시 표준 에러 (stderr) 메시지

new_home.cpp: In function 'int main()':
new_home.cpp:13:5: error: 'unordered' was not declared in this scope
   13 |     unordered<set> types;
      |     ^~~~~~~~~
new_home.cpp:13:18: error: missing template arguments before '>' token
   13 |     unordered<set> types;
      |                  ^
new_home.cpp:13:20: error: 'types' was not declared in this scope
   13 |     unordered<set> types;
      |                    ^~~~~