|
|
вернуться в форумTEST 3 Please I have got error so many times. Wonder wht I am missing.. Here is my Python 3.4 Code n,m=map(int,input().split()) g=list(map(int,input().split())) b=list(map(int,input().split())) g.sort() b.sort() minUpset=0 for i in range(0,n): minUpset+=g[i] for s in range(0,min(n,m)): girlsUpset=0 boysUpset=0 for i in range(0,n-s): girlsUpset+=g[i] for j in range(0,m-s): boysUpset+=b[j] minUpset=min(girlsUpset+boysUpset*s,minUpset) print(minUpset)
Re: TEST 3 Please Found the mistake. Always need to test when use loop. Re: TEST 3 Please for s in range(0, min(n, m) + 1) |
|
|