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 1709. Penguin-Avia

WA6
Posted by xurshid_n 4 Apr 2009 16:30
Please, give me some hint!
Re: WA6
Posted by svr 21 Apr 2009 11:51
Standard Prim's(Greedy) algo works if we assign -d to edges
in graph.
Re: WA6
Posted by ilucian1 30 Jun 2009 14:47
nothing special, just obtain a spanning tree (forest)... I think you made a confusion between verteces and parents, or something like that... try this example:
7
2 10
0000101
0000101
0001010
0010010
1100001
0011000
1100100

One of the correct answers is
16
00a000d
0000000
a0000d0
0000000
000000d
00d0000
d000d00
WA6 too
Posted by Muad Dib 6 Jul 2009 13:56
I've WA6 too. But on pervious test I've got AC. I use connected components of graph and Kruskal algo for builting spanning tree.
Re: WA6
Posted by Samsonov Alex [USU] 6 Jul 2009 20:38
Try to estimate the maximal possible answer to this problem.
Re: WA6
Posted by FatalityNT 23 Oct 2013 13:55
Thanks you. This test helped me to find the reason of WA6.
Re: WA6
Posted by Jane Soboleva (SumNU) 22 Feb 2016 06:26
Had a very silly WA6, and none of tests from this or neighbouring topics helped, so here's the one that i finally thought of and which helped:
5
1 1
01000
10001
00010
00101
01010
(1-2, 2-5, 5-4, 4-3, result is all zeros.)
I've been sleepy and lazy and did a bad job with a tree building algo, which i made like this:
---
(mark vertices 1..N as unconnected)
for i:=1 to N do
    for j:=1 to N do
        if (i, j) is an existing edge and either i or j is yet unconnected to anything,
            then add (i, j) to a tree and mark both i and j as connected.
---
So then it adds 1-2, then 2-5, then 3-4, and then it appears that both 4 and 5 are already connected to something, and 4-5 isn't included to a tree, which is a mistake.
Re: WA6
Posted by Mescheryakov_Kirill [SESC17] 31 Aug 2016 12:56
My programm have wa6? and on your test give:
16
0000000
000000d
000000a
00000d0
000000d
000d000
0da0d00

Is it correct?
Re: WA6
Posted by LLL 2 Oct 2016 11:07
helpful!thx