题解 | #超级闪光牛可乐#

超级闪光牛可乐

https://ac.nowcoder.com/acm/problem/266717

贪心即可,找到值最大的食物,直接喂1000次,如果可以就输出,不可以就输出-1

x = int(input())
n = int(input())
max1 = 0
maxtype = None
for _ in range(n):
    a,b = input().split()
    if int(b) > max1:
        max1 = int(b)
        maxtype = a
if 1000*max1 >= x:
    print(maxtype*1000)
else:
    print(-1)
全部评论

相关推荐

2024-12-30 22:49
长沙理工大学 Java
神哥了不得:没什么可以指导的地方了,简历确实牛,我大号分享过投递策略,广投就行
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务