Submission #698753

#TimeUsernameProblemLanguageResultExecution timeMemory
698753vjudge1New Home (APIO18_new_home)C++17
0 / 100
160 ms3400 KiB
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, q, k; cin >> n >> q >> k; int lb = INT_MAX, rb = 0; set<int> check; for (int i = 0; i < n; ++i) { int x, t, a, b; cin >> x >> t >> a >> b; lb = min(lb, x); rb = max(rb, x); check.insert(t); } while (q--) { int l, y; cin >> l >> y; if (check.size() != k) { cout << "-1\n"; } else { cout << max(abs(lb - l), abs(rb - l)) << "\n"; } } }

Compilation message (stderr)

new_home.cpp: In function 'int32_t main()':
new_home.cpp:26:26: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   26 |         if (check.size() != k) {
      |             ~~~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...