题解 | 支付宝消费打折

支付宝消费打折

https://www.nowcoder.com/practice/f8997c9b82714f058e12433a32614993

n,k=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input()))
h=[]
t=0
c=0
for i in range(n):
    if l2[i]==1:
        h.append((l1[i])*0.95)
    else:
        h.append(l1[i])
h.sort()
for j in h:  
    t+=j
    if t<=k:
        c+=1
    else:
        break

print(c)

    



        

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务