N = int(input())
all_list = []
for i in range(N):
the_list = list(map(int, input().split()))
all_list.append(the_list[1:])
T,D,E = 0,0,0
# 记录有掉落的果树
diaoluo = [0 for i in range(len(all_list))]
for the_list in all_list:
#果树初始果子数目
s = the_list[0]
for i in range(1, len(the_list)):
# 有疏果操作
if the_list[i] <= 0:
s = s + the_list[i]
# 存在果子掉落
elif the_list[i] < s:
#如果没有记录过就记录
if diaoluo[all_list.index(the_list)] != 1:
diaoluo[all_list.index(the_list)] = 1
D = D + 1
s = the_list[i]
T = T + s
for i in range(len(diaoluo)):
if i + 1 == len(diaoluo):
if diaoluo[i-1] == diaoluo [i] == diaoluo [0] == 1:
E = E + 1
else:
if diaoluo[i-1] == diaoluo [i] == diaoluo [i+1] == 1:
E = E + 1
print(T,D,E)
201909-2 小明种苹果(续)python实现 100分
最新推荐文章于 2020-10-13 19:35:33 发布