## 908-Re-connecting Computer Sites

Moderator: Board moderators

### 908-Re-connecting Computer Sites

i m surprised abt the problem. it is said that it will give n-1<=m<=n*n-1/2 ,here m is the number of edges and n is the numbner of node which can be 1 <= n <= 1000000. so clearly m edges cant be stored in an array. but surprisingly there is no input where m>n.a two dimensional array of array[1000020][3] is enough to store edges and cost.
Heal The World
calicratis19
Learning poster

Posts: 76
Joined: Mon Jul 21, 2008 8:50 am

### Re: 908-Re-connecting Computer Sites

In uva there are problems(such as 200,11042,935,(789,479 no test case )) of poor test cases , and this problem is also that type, the problem descripton is wrong also,
Learning poster

Posts: 74
Joined: Fri May 08, 2009 5:16 pm

### Re: 908-Re-connecting Computer Sites

Whats wrong with problem description? just add the costs of first N-1 inputs,and thats the first output. find MST of last K+M inputs,thats the 2nd output.
Shafaet_du
Experienced poster

Posts: 147
Joined: Mon Jun 07, 2010 11:43 am

### Re: 908-Re-connecting Computer Sites

Nothing wrong, but we should remember that second line (aka MST of K+M edges) should be min(cost_before, cost_after).

Shafaet_du wrote:Whats wrong with problem description? just add the costs of first N-1 inputs,and thats the first output. find MST of last K+M inputs,thats the 2nd output.
SyFyKid
New poster

Posts: 26
Joined: Tue May 08, 2012 9:47 am

### Re: 908-Re-connecting Computer Sites

Code: Select all
`AC, Blank lines were the problem :S`

I simply don't know, what am i doing wrong here, can someone please help me, or give me tricky I/O?
VitezVojko
New poster

Posts: 7
Joined: Sun Apr 15, 2012 4:45 pm