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

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

Hi everyone. I have a problem with computing the size (number of the nodes) of the largest SCC of a given graph: http://codeforces.com/predownloaded/97/d6/97d6203e45199e310ddef420c28c567917a89061.jpg. Problem statement is: Given a directed graph. Compute the size (number of the nodes) of its largest SCC. I want to use Kosaraju's algo (calling DFS on the given graph and its inverted version). What happens if I first go to node root->a->b and mark node "b" as visited, then go root->c->...? Since "b" is already marked visited, in this second path "b" will not be processed, right? Then how I count the number of the nodes of root->c->...->b->root?

UPDATE Solved. It turned out, that I misunderstood the term SCC.

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

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

Автор dilshodp, 8 лет назад, По-русски

On my PC this code outputs 1 9 3 for test№15. But in codeforce another output Here is my submition: http://codeforces.com/contest/618/submission/15669012 I think this is because of doubles, but I'm not sure. Could smb point my mistake, please?

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

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