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

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

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.

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

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

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

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 ^_^

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

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

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

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

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

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

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

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)

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

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

Автор err0r, история, 6 лет назад, По-английски
  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

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

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?

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

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