spirited_away_'s blog

By spirited_away_, history, 5 years ago, In English

Problem

The problem asks you to find all pairs of edges not included in shortest path.

Here is my two submissions :

correct one : in this, what i did is i fixed the edges and iterated on the nodes and check whether the particular edge can be included in the answer or not. It gives right answer.

Second one : WA : in this, i fixed the nodes and iterated on the edges that is present in our graph and check whether this particular edge can be included in the answer or not. It gave WA.

why second one is giving wa, though i think both have the same intution.

This is making the difference :

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

| Write comment?