文章

310

粉丝

0

获赞

123

访问

19.6k

头像
游船出租 题解:
P1321 浙江大学机试题
发布于2026年2月6日 15:39
阅读数 35

sell=dict()
total=0
count=0
while(1):
    try:
        num=list(map(str,input().split()))
        if len(num)==0:
            continue
        if(len(num)==1 and int(num[0])==-1):
            break
        else:
            if int(num[0])==0:#输出
                print(count,end=' ')
                if count==0:
                    print(0)
                else:
                    print(round(total/count))
                sell=dict()
                count=0
                total=0
            else:
                if num[1]=='S':
                    sell[num[0]]=num[2]
                if num[1]=='E':
                    if num[0] in sell:
                        count+=1
                        time1=list(map(int,num[2].split(":")))
                        h2=time1[0]
                        m2=time1[1]
                        time2=list(map(int,sell[num[0]].split(":")))
                        h1=time2[0]
 ...
登录查看完整内容


登录后发布评论

暂无评论,来抢沙发