err0r's blog

By err0r, history, 5 years ago, In English

In order to solve this problem i need to know occurrence of value X or the Kth element(after sorting) in a subarray for an array. can implicit treap be used to find the Kth element(after sorting) of a subarray?

In Implicit Treap the key values are not stored explicitly so in my approach i can`t use implicit treap like BST to find Kth element.

Full text and comments »

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

By err0r, history, 6 years ago, In English

How can i find maximum perfect matching in a bipartite graph?

it can be a a sub-graph of main bipartite graph? sub-graph contains a subset of vertex from left side and a subset of vertex from right side. if we take a vertex, each vertex that shares a edge with the selected vertex must be present in the subset of vertex too.



Thanks in Advance ^_^

Full text and comments »

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

By err0r, history, 6 years ago, In English

i have solved two similar problem recently 1027F & 875F

To solve 1027F i tried approach this problem using binary search and dsu but i am getting tle but my straightforward solution using kuhn`s algorithm got AC.

Can anyone explain the reason behind it? why kuhn`s is so fast here and why my dsu with binary search got TLE.

links to my submission

DSU kuhn

and to makes things more complicated for me

875F i tried this problem using kuhn got tle but i got AC using DSU.

links to my submission

DSU kuhn

it will be very helpful if anyone can explain this to me!! when and where should i use DSU or kuhn!!

kind regards

Full text and comments »

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

By err0r, history, 6 years ago, In English

these are the problems i solved so far!

1 2 3

*any other suggestions/advice related to flow will be very helpful!!
(specially how to approach them as i find it very difficult)

Full text and comments »

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

By err0r, history, 6 years ago, In English
  • Vote: I like it
  • +3
  • Vote: I do not like it

By err0r, history, 6 years ago, In English

Recently i learnt Aho-Corasick Algorithm for Pattern Searching. To find all occurrences of pattern strings in text string. i store all possible output links in my prefix tree(trie)

But case such as
text = aaaaa
pattern = {a, aa, aaa, aaaa, aaaaa}
will give me huge number of output link!

my implementation is there a better way to store them?

Full text and comments »

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