challengersy's blog

By challengersy, history, 8 years ago, In English

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)???

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?