-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf_1395_a.py
109 lines (69 loc) · 1.52 KB
/
cf_1395_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
n = {}
for i in range(int(input())):
c = list(map(int,input().split()))
evn = 0
odd = 0
m = min(c)
for j in range(1,len(c)+1):
c[j-1]-=m
for k in range(1, len(c)+1):
if c[k-1]%2==0:
evn += 1
elif c[k-1]%2==1:
odd += 1
if (odd == 1 or odd==0):
print("Yes")
else:
print("No")
# # print(c)
# mi = min(c)
# if mi!=0:
# for i in range(1,len(c)-1):
# if c[i-1]>=mi:
# c[i-1]-=mi
# if c[i-1]%2==1:
# o+=1
#
# if o==1:
# print("Yes")
# else:
# print("No")
# o=0
# e=0
# for i in range(int(input())):
# c = list(map(int,input().split()))
# for j in range(1,len(c)+1):
# if c[j-1]%2==1:
# o=1
# elif c[j-1]%2==0:
# e+=1
#
# print(o,e)
# if e==len(c) or e==len(c)-1 and o<=1:
# print("Yes")
# else:
# print("No")
#
#
#
# # f =0
# # for i in range(int(input())):
# # c = list(map(int,input().split()))
# # for j in range(2,len(c)+1):
# # if c[j-2]==c[j-1]:
# # f=1
# # else:
# # f==0
# #
# # if f==0:
# # for j in range(1,len(c)+1):
# # if(c[j-1]==1 or c[j-1]%3==0 or c[j-1]%2==0 )and c[j-1]!=0:
# # f=1
# # else:
# # f=0
# # break
# #
# # if f == 1:
# # print("Yes")
# # else:
# # print("No")