Uva 10164

Revision en3, by challengersy, 2016-04-23 09:11:08

description: giving 2N-1(N=2^k, k=1,2,3,4,5,6,7,8,9,10) numbers, each number is a positive integer not bigger than 1000. can you choose N of them, and add them all to a integer S, to make that S/N is a integer? this is the link:

problem source

i tried to solve this problem but i couldn't i saw a solution using backtracking. is it possible to use backrtacking here considering N=1000?? and there was another alorithm on this link algorithm source i understand: make a huge loop to get the answer randomly choose n differnt indices and get the elemnts check the sum? why didn't get TLE?? the loopis(100000000)*(n=1000)???

Tags dynamic programming, backtracking

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English challengersy 2016-04-23 09:11:08 54 (published)
en2 English challengersy 2016-04-23 09:10:08 0 (saved to drafts)
en1 English challengersy 2016-04-23 09:09:16 840 Initial revision (published)