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

Автор iamscrew, 9 лет назад, По-английски

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.

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

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

Автор iamscrew, 9 лет назад, По-английски

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.

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

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