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

Автор MathK30, история, 38 часов назад, По-английски

Hi guys,

I encountered a problem requiring us to find how many "Double Palindromes" are in the given input String.

A "Double Palindrome" is a string of concatenation of two palindromes with the same size. For example, "aabb", "aaaa" are the "Double Palindromes", but "abba" or "aaaabb" are not. Given an input string, the task is to calculate how many "Double Palindromes" exist in it. On the other word, our task is to calculate how many distinct pairs (l, r) satisfy the condition that S(l)S(l+1)...S(r) is "Double Palindromes".

Sample Input : "abacac" then output will be 6 because of : "ab", "ba", "ac", "ca", "ac" and "abacac" are "Double Palindromes".

Sorry for the missing: n <= 500000

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

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

Автор MathK30, история, 10 месяцев назад, По-английски

Hi Guys.

I meet a problem which we have to build a graph of n vertices such that the number of edges is minimized and among 3 vertices i j k, we have a least one of the edge i j, i k, or k j.

I think the solution would be to create 2 complete graphs, each with n / 2 vertices. But I can't prove that partitioning all n vertices into one complete graph and then removing some unnecessary edges is not more optimal than this. Please help me ToT.

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

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

Автор MathK30, история, 2 года назад, По-английски

Hi guys, i have 2 vector needed merge. How can I find min dictionary order of vector after merge.

ex : A = {2, 3} B = {4, 5}

one of satis way is : {2, 4, 5, 3}, opposite {3, 2, 4, 5}, {3, 2, 5, 4} is not.

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

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