iamscrew's blog

By iamscrew, 9 years ago, In English

Topological Sorting Help !!!

I read in tutorial to use the topological sorting in this question Fox and Names . I know that we have to find if there exists a order of alphabets such that name1<name2, name2<name3, name3<name4,and so on... but i could not help out how it is implemented and what is the basic idea behind this topological sorting algorithm? Can someone please help . ? Thanks in advance.

Full text and comments »

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

By iamscrew, 9 years ago, In English

Runtime error on spoj

I have tried solving this problem LITE on spoj using segment tree with lazy propagation. The answer is coming fine in all the cases, but still i am getting runtime error on it. A similar problem occured when i tried to solve HORRIBLE on spoj. I modified the array size but it doesn't worked out. Can anybody please please figure it out? Thanks in advance. Here's my code.

Full text and comments »

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