37,743
社区成员




a_limit, b_limit = [int(x) for x in input().split()]
n = int(input())
a_count = 0
b_count = 0
for i in range(n):
tmp = [int(x) for x in input().split()]
if tmp[0] + tmp[2] == tmp[1] and tmp[0] + tmp[2] != tmp[3]:
a_count += 1
elif tmp[0] + tmp[2] != tmp[1] and tmp[0] + tmp[2] == tmp[3]:
b_count += 1
if a_count > a_limit:
print('A')
print(b_count)
break
elif b_count > b_count:
print('B')
print(a_count)
break
大概这个样子result = [[0, False, 'A'], [0, False, 'B']]
with open(r'c:\zzz.txt', encoding='utf-8', mode='r+') as f:
l = f.read().splitlines()
A, B = map(int, l[0].split())
count = int(l[1])
for i in range(count):
Aj, Ah, Bj, Bh = map(int, l[2+i].split())
if Aj + Bj == Ah and Aj + Bj == Bh:
continue
elif Aj + Bj != Ah and Aj + Bj != Bh:
continue
elif Aj + Bj == Ah and Aj + Bj != Bh:
result[0][0] += 1
else:
result[1][0] += 1
if result[0][0] > A:
result[0][1] = True
break
if result[1][0] > B:
result[1][1] = True
break
print(str(list(filter(lambda x: x[1], result))[0][2]))
print(str(list(filter(lambda x: not x[1], result))[0][0]))
这个意思?