#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int t = 1;
while (t--) {
int n, type, q;
cin >> n >> type >> q;
vector<int> cur_type(type, 0);
vector<long long> loc(n+3), tp(n + 3), st(n + 3), ed(n + 3);
for (int i = 0; i < n; i++) {
cin >> loc[i] >> tp[i] >> st[i] >> ed[i];
tp[i]--;
cur_type[tp[i]]++;
}
int ok = 0, mx = *max_element(loc.begin(), loc.end()), mn = *min_element(loc.begin(), loc.end());
for (int i = 0; i < type; i++) if (cur_type[i] == 0) ok = 0;
for (int i = 0; i < q; i++) {
int u, ti; cin >> u >> ti;
if (ok == 1) {
cout << max(mx - u, u - mn) << '\n';
}
else cout << "-1\n";
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
155 ms |
10916 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
152 ms |
15828 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |