问题描述
| 试题编号: | 201909-2 |
| 试题名称: | 小明种苹果(续) |
| 时间限制: | 1.0s |
| 内存限制: | 512.0MB |
| 问题描述: |
|
n=int(input())
t=0
d=0
e=0
circle=[0]*n
for i in range(n):
num=list(map(int,input().split()))
flag=0
total=0
for j in range(1,num[0]+1):
if num[j]>0:
if total>num[j]:
flag=1
circle[i]=1
total=num[j]
else:
total+=num[j]
t+=total
if flag:
d+=1
for i in range(1,n-1):
if circle[i-1]==circle[i]==circle[i+1]==1:
e+=1
if circle[0]==circle[1]==circle[-1]==1:
e+=1
if circle[0]==circle[-2]==circle[-1]==1:
e+=1
print(t,d,e)



(Python100分)&spm=1001.2101.3001.5002&articleId=108903860&d=1&t=3&u=8ca86557b50d4e44aa1b4da95ae92ae8)
631

被折叠的 条评论
为什么被折叠?



