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 | 17ms | 3124 KiB | ||||
2 | Accepted | 17ms | 3124 KiB | ||||
3 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 18/18 | ||||||
4 | Accepted | 17ms | 3128 KiB | ||||
5 | Accepted | 17ms | 3136 KiB | ||||
6 | Accepted | 159ms | 3128 KiB | ||||
7 | Accepted | 45ms | 3568 KiB | ||||
8 | Accepted | 35ms | 3212 KiB | ||||
9 | Accepted | 16ms | 3132 KiB | ||||
10 | Accepted | 45ms | 3128 KiB | ||||
11 | Accepted | 37ms | 3128 KiB | ||||
12 | Accepted | 16ms | 3128 KiB | ||||
13 | Accepted | 39ms | 3056 KiB | ||||
subtask3 | 0/19 | ||||||
14 | Accepted | 27ms | 5688 KiB | ||||
15 | Accepted | 691ms | 3120 KiB | ||||
16 | Accepted | 34ms | 5176 KiB | ||||
17 | Accepted | 35ms | 5680 KiB | ||||
18 | Time limit exceeded | 3.086s | 5688 KiB | ||||
19 | Time limit exceeded | 3.099s | 5696 KiB | ||||
20 | Accepted | 17ms | 3020 KiB | ||||
21 | Accepted | 23ms | 4240 KiB | ||||
22 | Accepted | 252ms | 5812 KiB | ||||
23 | Time limit exceeded | 3.082s | 5812 KiB | ||||
24 | Time limit exceeded | 3.088s | 5688 KiB | ||||
25 | Accepted | 79ms | 5688 KiB | ||||
26 | Accepted | 43ms | 3128 KiB | ||||
subtask4 | 0/24 | ||||||
27 | Accepted | 172ms | 33288 KiB | ||||
28 | Time limit exceeded | 3.086s | 3640 KiB | ||||
29 | Time limit exceeded | 3.088s | 35100 KiB | ||||
30 | Time limit exceeded | 3.088s | 35864 KiB | ||||
31 | Time limit exceeded | 3.089s | 35608 KiB | ||||
32 | Time limit exceeded | 3.089s | 35676 KiB | ||||
33 | Accepted | 1.235s | 3952 KiB | ||||
34 | Time limit exceeded | 3.092s | 34844 KiB | ||||
35 | Time limit exceeded | 3.084s | 35608 KiB | ||||
36 | Time limit exceeded | 3.082s | 35864 KiB | ||||
37 | Time limit exceeded | 3.082s | 35608 KiB | ||||
38 | Time limit exceeded | 3.084s | 35868 KiB | ||||
39 | Time limit exceeded | 3.085s | 3384 KiB | ||||
subtask5 | 0/22 | ||||||
40 | Accepted | 167ms | 33580 KiB | ||||
41 | Accepted | 850ms | 3072 KiB | ||||
42 | Accepted | 57ms | 13284 KiB | ||||
43 | Accepted | 180ms | 35292 KiB | ||||
44 | Time limit exceeded | 3.081s | 35856 KiB | ||||
45 | Time limit exceeded | 3.086s | 35344 KiB | ||||
46 | Accepted | 16ms | 3168 KiB | ||||
47 | Accepted | 16ms | 3076 KiB | ||||
48 | Accepted | 48ms | 11104 KiB | ||||
49 | Time limit exceeded | 3.088s | 33172 KiB | ||||
50 | Time limit exceeded | 3.091s | 35868 KiB | ||||
51 | Time limit exceeded | 3.085s | 35708 KiB | ||||
52 | Accepted | 2.269s | 35428 KiB | ||||
53 | Accepted | 45ms | 3132 KiB | ||||
subtask6 | 0/17 | ||||||
54 | Accepted | 231ms | 45476 KiB | ||||
55 | Time limit exceeded | 3.086s | 45528 KiB | ||||
56 | Accepted | 230ms | 45208 KiB | ||||
57 | Accepted | 194ms | 44972 KiB | ||||
58 | Time limit exceeded | 3.085s | 44624 KiB | ||||
59 | Time limit exceeded | 3.101s | 44496 KiB | ||||
60 | Accepted | 386ms | 45384 KiB | ||||
61 | Accepted | 211ms | 45512 KiB | ||||
62 | Accepted | 212ms | 44984 KiB | ||||
63 | Time limit exceeded | 3.091s | 44780 KiB | ||||
64 | Time limit exceeded | 3.088s | 44904 KiB | ||||
65 | Time limit exceeded | 3.091s | 44496 KiB | ||||
66 | Time limit exceeded | 3.101s | 26296 KiB |