-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf_1408_a.py
120 lines (111 loc) · 2.97 KB
/
cf_1408_a.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
t = int(input())
for i in range(t):
n = int(input())
a = list(map(int, input().split()))[:n]
b = list(map(int, input().split()))[:n]
c = list(map(int, input().split()))[:n]
p = []
f = 0
f1 = 0
f2 = 0
p.append(a[0])
for j in range(1,n):
l = len(p)
if f == 0 and a[j-1] != a[j]:
p.append(a[j])
if f == 0 and a[j - 1] == a[j]:
p.append(b[j])
f = 1
if f == 1 and b[j-1] != b[j]:
p.append(b[j])
f = 1
if f == 1 and b[j-1] == b[j]:
p.append(c[j])
f = 1
if f == 1 and c[j-1] != c[j]:
p.append(c[j])
f = 0
elif f == 2 and c[j-1] == c[j]:
p.append(b[j])
f = 1
print("----")
print(*p,sep=" ")
# for j in range(0,n-1):
# l = len(p)
# if (a[j-1] != a[j]):
# if l <=n and p[l-1] != a[j-1]:
# f = 1
# p.append(a[j - 1])
# if f == 0:
# p.append(a[0])
#
# for j in range(0, n - 1):
# l = len(p)
# if (b[j - 1] != b[j]):
# if l <= n and p[l - 1] != b[j - 1]:
# p.append(b[j - 1])
# f1 = 1
# if f1 == 0:
# p.append(b[0])
#
# p.append(c[0])
# for j in range(0, n - 1):
# l = len(p)
# if (c[j - 1] != c[j]):
# if l <= n and p[l - 1] != c[j - 1]:
# p.append(c[j - 1])
# f2 = 1
# if f2 == 0:
# p.append(c[0])
# print(p)
# for j in range(1,n):
# if (f==0) and (a[j-1] == a[j]):
# f = 1
# l = len(p)
# if l>0 and p[l-1]!=a[j-1]:
# p.append(a[j - 1])
# else:
# p.append(a[j-1])
#
# elif (a[j-1] != a[j]):
# l = len(p)
# if l > 0 and p[l - 1] != a[j - 1]:
# p.append(a[j - 1])
# else:
# p.append(a[j - 1])
# print(p)
#
# for j in range(1,n):
# if (f1==0) and (b[j-1] == b[j]):
# f1 = 1
#
# l = len(p)
# if l > 0 and p[l - 1] != b[j - 1]:
# p.append(b[j - 1])
# else:
# p.append(b[j - 1])
#
# elif (b[j-1] != b[j]):
# l = len(p)
# if l > 0 and p[l - 1] != b[j - 1]:
# p.append(b[j - 1])
# else:
# p.append(b[j - 1])
# print(p)
#
# for j in range(1,n):
# if (f2 == 0) and (c[j-1] == c[j]):
# f2 = 1
# l = len(p)
# if l > 0 and p[l - 1] != c[j - 1]:
# p.append(c[j - 1])
# else:
# p.append(c[j - 1])
# elif (c[j-1] != c[j]):
# l = len(p)
#
# if l > 0 and p[l - 1] != c[j - 1]:
# p.append(c[j - 1])
# else:
# p.append(c[j - 1])
# print(p)