-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2013-j5.py
125 lines (108 loc) · 3.18 KB
/
2013-j5.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
121
122
123
124
125
team = int(input())
games = int(input())
t1S = 0
t2S = 0
t3S = 0
t4S = 0
t1M= 0
t2M = 0
t3M = 0
t4M = 0
win = 3
tie = 1
loss = 0
outcomes = 18
for i in range(games):
line = input().split()
line = [int(i) for i in line]
#[1, 3, 7, 5]
if line[0] == 1:
t1M = t1M + 1
if line[1] == 2:
t2M = t2M + 1
if line[2] > line[3]:
t1S = t1S + win
outcomes = outcomes - 3
elif line[2] < line[3]:
t2S = t2S + win
outcomes = outcomes - 3
if line[2] == line[3]:
t1S = t1S + tie
t2S = t2S + tie
outcomes = outcomes - 3
if line[1] == 3:
t3M = t3M + 1
if line[2] > line[3]:
t1S = t1S + win
outcomes = outcomes - 3
elif line[2] < line[3]:
t3S = t3S + win
outcomes = outcomes - 3
if line[2] == line[3]:
t1S = t1S + tie
t3S = t3S + tie
outcomes = outcomes - 3
if line[1] == 4:
t4M = t4M + 1
if line[2] > line[3]:
t1S = t1S + win
outcomes = outcomes - 3
elif line[2] < line[3]:
t4S = t4S + win
outcomes = outcomes - 3
if line[2] == line[3]:
t1S = t1S + tie
t4S = t4S + tie
outcomes = outcomes - 3
if line[0] == 2:
t2M = t2M + 1
if line[1] == 3:
t3M = t3M + 1
if line[2] > line[3]:
t2S = t2S + win
outcomes = outcomes - 3
elif line[2] < line[3]:
t3S = t3S + win
outcomes = outcomes - 3
if line[2] == line[3]:
t2S = t2S + tie
t3S = t3S + tie
outcomes = outcomes - 3
if line[1] == 4:
t4M = t4M + 1
if line[2] > line[3]:
t2S = t2S + win
outcomes = outcomes - 3
elif line[2] < line[3]:
t4S = t4S + win
outcomes = outcomes - 3
elif line[2] == line[3]:
t2S = t2S + tie
t4S = t4S + tie
outcomes = outcomes - 3
if line[0] == 3:
t3M = t3M + 1
if line[1] == 4:
t4M = t4M + 1
if line[2] > line[3]:
t3S = t3S + win
outcomes = outcomes - 3
elif line[2] < line[3]:
t4S = t4S + win
outcomes = outcomes - 3
if line[2] == line[3]:
t3S = t3S + tie
t4S = t4S + tie
outcomes = outcomes - 3
if team == 1:
if t1S == 0 and t1M > 2:
print(t1S)
if team == 2:
if t2S == 0 and t2M > 2:
print(t2S)
if team == 3:
if t3S == 0 and t3M > 2:
print(t3S)
if team == 4:
if t4S == 0 and t4M > 2:
print(t4S)