# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
59226 | Just_Solve_The_Problem | New Home (APIO18_new_home) | C++11 | 5081 ms | 24780 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 7;
int n, k, q;
int x[N], t[N], a[N], b[N];
int mn[404];
main() {
scanf("%d %d %d", &n, &k, &q);
for (int i = 1; i <= n; i++) {
scanf("%d %d %d %d", &x[i], &t[i], &a[i], &b[i]);
}
while (q--) {
int l, y;
scanf("%d %d", &l, &y);
memset(mn, 63, sizeof mn);
for (int i = 1; i <= n; i++) {
if (a[i] <= y && y <= b[i]) {
mn[t[i]] = min(mn[t[i]], abs(l - x[i]));
}
}
int ans = -1;
for (int i = 1; i <= k; i++) {
if (mn[i] == mn[0]) {
ans = -1;
break;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |