# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
842782 | 2023-09-03T11:22:54 Z | SUNWOOOOOOOO | Jail (JOI22_jail) | C++17 | 59 ms | 5308 KB |
#include <bits/stdc++.h> using namespace std; using pint = array <int, 2>; const int mxN = 120005; vector <int> ans; vector <pint> v1, v2; int n, m; int solve() { sort(v1.begin(), v1.end()); sort(v2.begin(), v2.end()); for (int i = 0; i < m; i++) { if (v1[i][1] != v2[i][1]) return 0; } return 1; } int main() { int q; scanf("%d", &q); while (q--) { scanf("%d", &n); for (int i = 0, a, b; i < n - 1; i++) scanf("%d %d", &a, &b); scanf("%d", &m); v1.clear(); v2.clear(); for (int i = 0, s, t; i < m; i++) { scanf("%d %d", &s, &t); v1.push_back({s, i}); v2.push_back({t, i}); } ans.push_back(solve()); } for (int elm : ans) { if (elm) printf("Yes\n"); else printf("No\n"); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 484 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 7 ms | 604 KB | Output is correct |
5 | Correct | 15 ms | 956 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 2 ms | 348 KB | Output is correct |
9 | Correct | 20 ms | 1672 KB | Output is correct |
10 | Correct | 18 ms | 1856 KB | Output is correct |
11 | Correct | 4 ms | 348 KB | Output is correct |
12 | Correct | 22 ms | 1372 KB | Output is correct |
13 | Correct | 27 ms | 3416 KB | Output is correct |
14 | Correct | 27 ms | 3416 KB | Output is correct |
15 | Correct | 34 ms | 3448 KB | Output is correct |
16 | Correct | 59 ms | 5308 KB | Output is correct |
17 | Correct | 29 ms | 3532 KB | Output is correct |
18 | Correct | 42 ms | 5240 KB | Output is correct |
19 | Correct | 30 ms | 3528 KB | Output is correct |
20 | Correct | 30 ms | 3588 KB | Output is correct |
21 | Correct | 35 ms | 3724 KB | Output is correct |
22 | Correct | 29 ms | 3644 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 432 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 5 ms | 544 KB | Output is correct |
6 | Incorrect | 1 ms | 348 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 484 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 7 ms | 604 KB | Output is correct |
5 | Correct | 15 ms | 956 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 2 ms | 348 KB | Output is correct |
9 | Correct | 20 ms | 1672 KB | Output is correct |
10 | Correct | 18 ms | 1856 KB | Output is correct |
11 | Correct | 4 ms | 348 KB | Output is correct |
12 | Correct | 22 ms | 1372 KB | Output is correct |
13 | Correct | 27 ms | 3416 KB | Output is correct |
14 | Correct | 27 ms | 3416 KB | Output is correct |
15 | Correct | 34 ms | 3448 KB | Output is correct |
16 | Correct | 59 ms | 5308 KB | Output is correct |
17 | Correct | 29 ms | 3532 KB | Output is correct |
18 | Correct | 42 ms | 5240 KB | Output is correct |
19 | Correct | 30 ms | 3528 KB | Output is correct |
20 | Correct | 30 ms | 3588 KB | Output is correct |
21 | Correct | 35 ms | 3724 KB | Output is correct |
22 | Correct | 29 ms | 3644 KB | Output is correct |
23 | Correct | 0 ms | 348 KB | Output is correct |
24 | Correct | 0 ms | 432 KB | Output is correct |
25 | Correct | 1 ms | 348 KB | Output is correct |
26 | Incorrect | 1 ms | 348 KB | Output isn't correct |
27 | Halted | 0 ms | 0 KB | - |