AzorAhai's blog

By AzorAhai, history, 8 years ago, In English

Hi guys, I need your help in this problem. it is problem 'K' (subpalindroms) in this contest http://www.codeforces.com/gym/100032/attachments. in the problem a string S with length < 10^5 is given and want us to answer m <3*10^5 queries, each query want us to count the number of palindromic substrings in a given interval. I couldn't find any solution better than O(n^2) although I tried to use hashing and palindromic tree any hint please .. thanks in advance.

Full text and comments »

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

By AzorAhai, history, 8 years ago, In English

Hi guys Can someone please give me a good resource of how to solve dynamic graph connectivity and dynamic lca using treaps or how to implement link cut trees using treaps .. i can not find any good resources for that. thanks in advance guys.

Full text and comments »

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

By AzorAhai, history, 8 years ago, In English

Hi guys, I was trying to solve this problem http://acm.timus.ru/problem.aspx?space=1&num=1459 obviously the solution is counting simple cycles between cell (1,1) and cell (n,m) in the given grid. but since m is very large I think that we need to use matrix power to solve this problem .. but I could't find any recurrence to use.. any help please?? thanks in advance.

Full text and comments »

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

By AzorAhai, history, 8 years ago, In English

Hi guys, Could anyone give me a good list of problems on palindromic Tree and treaps specially implicit treaps and reverse intervals and dp optimization tricks because I can't find good problems on those topics .. Thanks in advance.

Full text and comments »

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