P1049 python40分 2RE 1,5WA
查看原帖
P1049 python40分 2RE 1,5WA
1050236
PLDD楼主2024/3/23 09:23
a = int(input())
b = int(input())
c = []
for i in range(b):
    d = int(input())
    c.append(d)
while True:
    if a >= max(c):
        a -= max(c)
        c.remove(max(c))
    elif a >= min(c):
        a -= min(c)
        c.remove(min(c))
    elif a < min(c):
        break
print(a)

红 紫 绿 绿 红

求调给思路

2024/3/23 09:23
加载中...