Submission #698760

#TimeUsernameProblemLanguageResultExecution timeMemory
698760haxormanNew Home (APIO18_new_home)C++14
0 / 100
154 ms3296 KiB
#include <bits/stdc++.h> using namespace std; #define int long long 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:28:26: warning: comparison of integer expressions of different signedness: 'std::set<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   28 |         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...