假设有N个人要玩游戏,每轮游戏必须选出一个人当裁判,剩下的N-1个人作为玩家。现在第i个人要求作为玩家进行至少Ai轮游戏,那么至少需要进行多少轮游戏才能满足所有人的要求?
N = int(input()) A = list(map(int, input().split())) m = max(A) if m < N: print(N) else: ans = m+1 while(ans*N-sum(A)<ans): ans += 1 print(ans)为什么才4/20?
num=int(input()) people=list(map(int,input().split())) people.sort() sum=0 have_people_over=0 while(len(people)!=1&nbs***bsp;people[0]!=0): if(people[0]==0): while(1): try: people.pop(people.index(0)) have_people_over=1 except: break people=[i-1 for i in people] people.sort() if(have_people_over==0): people[int(len(people)/2)]+=1 sum+=1 print(sum)