这题的意思是给你 n 道菜,第 i 道菜需要 Ai 步才能完成 每次你能对 m 道菜分别完成一步,请问最少需要几次? 这题暴力写肯定是不行的,去年省赛的时候就是没写出来这题,今天再把思路理一理吧. 首先我们需要明确的是 1. n <= m 的时候, 那么答案显而易见,就是 Max (A[i]) 2. n > m ①此时我们不难发现这个现象,如果 sum (A[i]) 能被 m 整除,那么我们可能恰恰只需要 (sum / m) 次即可完成 一个例子: n = 3, m = 2 a[1] = 1,…
Description As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hearty dinner with his girlfriend at his home. Of course, Coach Gao is going to cook all dishes himself, in…
Talented Chef Time Limit: 2 Seconds Memory Limit: 65536 KB As we all know, Coach Gao is a talented chef, because he is able to cook M dishes in the same time. Tonight he is going to have a hearty dinner with his girlfriend at his home. Of course, Coa…