Uva 10164

Правка en1, от challengersy, 2016-04-23 09:09:16

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:

Your text to link here...

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 Your text to link here... 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)???

Теги dynamic programming, backtracking

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский challengersy 2016-04-23 09:11:08 54 (published)
en2 Английский challengersy 2016-04-23 09:10:08 0 (saved to drafts)
en1 Английский challengersy 2016-04-23 09:09:16 840 Initial revision (published)