大佬求3、4、6样例数据
查看原帖
大佬求3、4、6样例数据
1170071
Operation0701楼主2023/11/14 17:32
n,m = map(int,input().split())
l = list(map(int,input().split()))
use = l[:m]
wait = l[m:][::-1]
time = 0
while wait:
    mi = min(use)
    time += mi
    for i in range(m):
        use[i] = use[i] - mi
        if use[i] == 0:
            use[i] = wait.pop()
        if not wait:
            break
time += max(use)
print(time)

我也不知道为啥就346不过啊,是没有考虑特殊情况吗。蒟蒻求大佬解答。

2023/11/14 17:32
加载中...