priojeet_priyom's blog

By priojeet_priyom, history, 5 years ago, In English

my approach to this problem is:
1. build mst using prims
2. run a bfs from any special node to find the maximum edge between special nodes and that edge is the answer for all nodes.
my submission

Full text and comments »

By priojeet_priyom, history, 6 years ago, In English

Tried solving 149 E Martian Strings using z-algo. my approach is: compute z value for pattern$text and reverse(pattern)$reverse(text). then find the minimum index for each prefix length match and find the maximum index suffix length match for all length i (0<=i<length(pattern). the complexity of my code is approx O(m*n) which is 10^7. getting TLE. tried optimizing but no luck till now, also tried reading others code but could make sense out of those. my code: submission link

Full text and comments »

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

By priojeet_priyom, history, 7 years ago, In English

I had some problems that I wanted to solve later. So tried adding in my favorite list.Though the star indicator became yellow in problem page, it wasn't added in my favorite problem list. Please take a look on this issue, MikeMirzayanov.

Full text and comments »

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