Блог пользователя challengersy

Автор challengersy, история, 8 лет назад, По-английски

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?

Полный текст и комментарии »

  • Проголосовать: нравится
  • -13
  • Проголосовать: не нравится

Автор challengersy, история, 9 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор challengersy, история, 9 лет назад, По-английски

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?

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится