School Team Contest 3 (Winter Computer School 2010/11)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
45 School Team Contest 3 (Winter Computer School 2010/11) FINISHED False 18000 486673180 Nov. 13, 2010, 11 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 226 ) H Road Problem PROGRAMMING graphs 2600

The Berland capital (as you very well know) contains n junctions, some pairs of which are connected by two-way roads. Unfortunately, the number of traffic jams in the capital has increased dramatically, that's why it was decided to build several new roads. Every road should connect two junctions. The city administration noticed that in the cities of all the developed countries between any two roads one can drive along at least two paths so that the paths don't share any roads (but they may share the same junction). The administration decided to add the minimal number of roads so that this rules was fulfilled in the Berland capital as well. In the city road network should exist no more than one road between every pair of junctions before or after the reform. The first input line contains a pair of integers n , m ( 2 ≤ n ≤ 900, 1 ≤ m ≤ 100000 ), where n is the number of junctions and m is the number of roads. Each of the following m lines contains a description of a road that is given by the numbers of the connected junctions a i , b i ( 1 ≤ a i , b i ≤ n , a i ≠ b i ). The junctions are numbered from 1 to n . It is possible to reach any junction of the city from any other one moving along roads. On the first line print t — the number of added roads. Then on t lines print the descriptions of the added roads in the format of the input data. You can use any order of printing the roads themselves as well as the junctions linked by every road. If there are several solutions to that problem, print any of them. If the capital doesn't need the reform, print the single number 0 . If there's no solution, print the single number -1 .

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
194186 tourist H Nov. 13, 2010, 2:25 p.m. OK Delphi TESTS 50 50 43212800 2600
193535 zpl1 chensqi plokzfadai H Nov. 13, 2010, 1:31 p.m. OK GNU C TESTS 50 60 8294400 2600

remove filters

Back to search problems