v-O_O-v's blog

By v-O_O-v, history, 5 years ago, In English

I have solved 285C - Building Permutation using a greedy approach i.e sort all the values and then count the number of moves to make first element 1, the next to 2 and so on... But how can we come to the conclusion that this is always optimal and produces the minimum number of moves?

Full text and comments »

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

By v-O_O-v, history, 5 years ago, In English

So I was learning suffix array and how to implement it. I was not able to implement it myself so I took unused code for constructing suffix array I was able to understand the initial steps but was not able to understand what is happening after the 'Start' in code below. Please help me. Thanks.

Code

Full text and comments »

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

By v-O_O-v, history, 5 years ago, In English

Hi, I started studying string alg's and I did not really understand how do we construct a suffix array in O(n*log n). I can implement an O(n^2 log n) alg. But it can fail for reasonably long strings. Can someone please provide a detailed implementation (if possible with comments) of the suffix array. I saw the codes of some users but I am not able to understand anything from it. Please help me. Thanks.

Full text and comments »

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

By v-O_O-v, history, 5 years ago, In English

I recently started learning graph theory and I completed the traversal algorithms. I am having difficulties in implementing the code which are applications of the traversal. So can anyone share their implementation of basic graph questions like

  1. Check whether an undirected graph is acyclic if not print the cycle.
  2. How to get all paths from a source vertex to a destination in a Directed graph.

Thanks!

Full text and comments »

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

By v-O_O-v, history, 6 years ago, In English

 Errichto has made to top 1 on the contribution panel.

Full text and comments »

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

By v-O_O-v, history, 6 years ago, In English

214A - System of Equations Of course, we can do this using brute-force method. Does a better way exists please share it. Thanks.

Full text and comments »

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

By v-O_O-v, history, 6 years ago, In English

Does anyone have a simpler approach of solving this problem? Please share with me.

Full text and comments »

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

By v-O_O-v, history, 6 years ago, In English

Hello! I am unable to find any resource on implementing pick's theorem for a polygon in c++. Can anyone suggest me a site or code where i can understand it.

Thanks.

Full text and comments »

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