challengersy's blog

By challengersy, history, 8 years ago, In English

Hi, I tried to solve this problem. I used two vectors to store occurrences of both prefix and suffix; the problem was how to indicate that two sub-strings are different I looked for other submissions i notice that they used a map and a long long number to have this. my question is: wouldn't we have an overflow? how can we be sure that two different sub strings wouldn't have the same number as a result of overflow?

Full text and comments »

  • Vote: I like it
  • -13
  • Vote: I do not like it

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

Full text and comments »

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

By challengersy, history, 8 years ago, In English

I am getting WA.this is my code: i dont know how to post a code,this is my first,sorry.

if anybody can help me with critical input?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it