from itertools import combinations
def main():
input()
poses = {tuple(map(int, x)) for x in zip(*[input().strip().split() for _ in range(3)])}
for from_pos, to_pos in combinations(poses, 2):
ghost_pos = list(from_pos)
dirs = ((to_pos[0] > ghost_pos[0]) - (to_pos[0] < ghost_pos[0]),
(to_pos[1] > ghost_pos[1]) - (to_pos[1] < ghost_pos[1]),
(to_pos[2] > ghost_pos[2]) - (to_pos[2] < ghost_pos[2]))
while ghost_pos != list(to_pos):
for axis in range(3):
if ghost_pos[axis] != to_pos[axis]:
next_pos = ghost_pos[:]
next_pos[axis] += dirs[axis]
if tuple(next_pos) in poses:
ghost_pos[axis] += dirs[axis]
break
else:
print("NO")
return
print("YES")
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 65ms | 36552 KiB | ||||
2 | Accepted | 68ms | 33300 KiB | ||||
3 | Accepted | 65ms | 37808 KiB | ||||
subtask2 | 18/18 | ||||||
4 | Accepted | 46ms | 19644 KiB | ||||
5 | Accepted | 46ms | 19644 KiB | ||||
6 | Accepted | 178ms | 25296 KiB | ||||
7 | Accepted | 122ms | 24256 KiB | ||||
8 | Accepted | 116ms | 22540 KiB | ||||
9 | Accepted | 46ms | 19644 KiB | ||||
10 | Accepted | 114ms | 22344 KiB | ||||
11 | Accepted | 119ms | 22600 KiB | ||||
12 | Accepted | 52ms | 21232 KiB | ||||
13 | Accepted | 70ms | 21704 KiB | ||||
subtask3 | 0/19 | ||||||
14 | Accepted | 59ms | 23272 KiB | ||||
15 | Accepted | 470ms | 22624 KiB | ||||
16 | Accepted | 64ms | 23024 KiB | ||||
17 | Accepted | 566ms | 24800 KiB | ||||
18 | Time limit exceeded | 3.084s | 26128 KiB | ||||
19 | Time limit exceeded | 3.104s | 26600 KiB | ||||
20 | Accepted | 79ms | 21992 KiB | ||||
21 | Accepted | 64ms | 22512 KiB | ||||
22 | Accepted | 377ms | 24468 KiB | ||||
23 | Accepted | 2.756s | 25324 KiB | ||||
24 | Time limit exceeded | 3.088s | 25836 KiB | ||||
25 | Accepted | 177ms | 24824 KiB | ||||
26 | Accepted | 64ms | 21740 KiB | ||||
subtask4 | 0/24 | ||||||
27 | Accepted | 172ms | 60992 KiB | ||||
28 | Time limit exceeded | 3.076s | 23380 KiB | ||||
29 | Time limit exceeded | 3.079s | 62604 KiB | ||||
30 | Time limit exceeded | 3.079s | 62780 KiB | ||||
31 | Time limit exceeded | 3.094s | 62708 KiB | ||||
32 | Time limit exceeded | 3.088s | 62580 KiB | ||||
33 | Accepted | 243ms | 22764 KiB | ||||
34 | Time limit exceeded | 3.108s | 62780 KiB | ||||
35 | Time limit exceeded | 3.088s | 62636 KiB | ||||
36 | Time limit exceeded | 3.086s | 62636 KiB | ||||
37 | Time limit exceeded | 3.098s | 62660 KiB | ||||
38 | Time limit exceeded | 3.108s | 62772 KiB | ||||
39 | Time limit exceeded | 3.086s | 22508 KiB | ||||
subtask5 | 0/22 | ||||||
40 | Accepted | 199ms | 61584 KiB | ||||
41 | Accepted | 536ms | 22692 KiB | ||||
42 | Accepted | 174ms | 32036 KiB | ||||
43 | Accepted | 190ms | 60568 KiB | ||||
44 | Time limit exceeded | 3.095s | 62344 KiB | ||||
45 | Time limit exceeded | 3.108s | 62884 KiB | ||||
46 | Accepted | 71ms | 22116 KiB | ||||
47 | Accepted | 61ms | 21996 KiB | ||||
48 | Accepted | 597ms | 28772 KiB | ||||
49 | Time limit exceeded | 3.088s | 56012 KiB | ||||
50 | Accepted | 1.615s | 62128 KiB | ||||
51 | Time limit exceeded | 3.091s | 62524 KiB | ||||
52 | Accepted | 1.378s | 62492 KiB | ||||
53 | Accepted | 105ms | 21744 KiB | ||||
subtask6 | 0/17 | ||||||
54 | Accepted | 175ms | 64200 KiB | ||||
55 | Time limit exceeded | 3.092s | 63536 KiB | ||||
56 | Accepted | 212ms | 63472 KiB | ||||
57 | Accepted | 215ms | 63700 KiB | ||||
58 | Time limit exceeded | 3.092s | 63272 KiB | ||||
59 | Time limit exceeded | 3.108s | 63384 KiB | ||||
60 | Accepted | 536ms | 63668 KiB | ||||
61 | Accepted | 209ms | 63564 KiB | ||||
62 | Accepted | 214ms | 63280 KiB | ||||
63 | Time limit exceeded | 3.096s | 63788 KiB | ||||
64 | Time limit exceeded | 3.091s | 63792 KiB | ||||
65 | Accepted | 833ms | 62768 KiB | ||||
66 | Time limit exceeded | 3.107s | 62060 KiB |