import sys
n = int(input())
y = 0
f = 0
p = 0
b = [0 for i in range(5)]
c = [0 for j in range(5)]
for i in range(n):
a = sys.stdin.readline()
a0, a1 = a.split()
if a0 == 'C' and a1 == 'C':
p += 1
if a0 == 'C' and a1 == 'J':
y += 1
b[1] += 1
if a0 == 'C' and a1 == 'B':
f += 1
c[0] += 1
if a0 == 'J' and a1 == 'C':
f += 1
c[1] += 1
if a0 == 'J' and a1 == 'J':
p += 1
if a0 == 'J' and a1 == 'B':
y += 1
b[2] += 1
if a0 == 'B' and a1 == 'C':
y += 1
b[0] += 1
if a0 == 'B' and a1 == 'J':
f += 1
c[2] += 1
if a0 == 'B' and a1 == 'B':
p += 1
print(y, p, f)
print(f, p, y)
if b[0] >= b[1] and b[0] >= b[2]:
s1 = 'B'
elif b[1] >= b[2] and b[1] > b[0]:
s1 = 'C'
else:
s1 = 'J'
if c[0] >= c[1] and c[0] >= c[2]:
s2 = 'B'
elif c[1] >= c[2] and c[1] > c[0]:
s2 = 'C'
else:
s2 = 'J'
print(s1, s2, end='')
代码
没有 sys必定超时,有了sys不会超
?
|