文章

310

粉丝

0

获赞

123

访问

19.6k

头像
排名 题解:
P1346 浙江大学机试题
发布于2026年2月6日 09:31
阅读数 52

while(1):
    try:
        num=list(map(int,input().split()))
        if(len(num)==1):
            if(num[0]==0):
                break
        n=num[0]
        m=num[1]
        g=num[2]
        fenzhi=list(map(int,input().split()))#每题的分值
        t=[]
        count=0
        for i in range(n):
            s=list(map(str,input().split()))
            name=s[0]
            l=int(s[1])
            score=0
            for j in range(l):
                score+=fenzhi[int(s[2+j])-1]
            if score>=g:
                count+=1
            else:
                continue
            t.append([name,score])
        print(count)
        k=sorted(t,key=lambda x:(-x[1],x[0]))
        for i in k:
            print(i[0],end=' ')
            print(i[1])
    except:
        break
登录查看完整内容


登录后发布评论

暂无评论,来抢沙发