ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1004. Sightseeing Trip

Confused with description, please help.
Posted by Alexander Shulgin 29 Jul 2004 18:53
Greetings, The One, Who Reads This.

Let us consider such input:

4 2
1 2 1
3 4 10
-1

Why should not we consider a way from 1st crossing to the 2nd one and back (as roads _are_ two-way) a sightseeing route ?

k = 2

x1 = 1
x2 = 2

x1 != x2 (numbers x1 and x2 _are_ different)

y1: 1->2
y2: 2->1

Thanks,
Alex
Note: K > 2 (!)
Posted by xakac 12 Sep 2004 18:54
In this case you have k = 1 roads. Even if you connect two crossing points with two different roads, you will have k = 2. But the condition says that there must be k > 2 roads.

Read in carefully.
(continue)
Posted by xakac 12 Sep 2004 18:57
And the condition 'two-way roads' is needed only for you don't mind in wich direction you can go by the road.