Submission #946089

#TimeUsernameProblemLanguageResultExecution timeMemory
946089itslqNew Home (APIO18_new_home)C++17
Compilation error
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'; } }

Compilation message (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;
      |                    ^~~~~