I was using union-find algorithm at the contest. But I got several WA's. I think my program failed in handling reversible connection (i.e. 1->2 and 2->1).
i use union-find algorithm , and i got WA too . i think this algorithm is correct , but why i got wrong ?
That's because union-find is for ...
Search found 27 matches
- Mon Sep 29, 2008 1:19 am
- Forum: Volume 115 (11500-11599)
- Topic: 11504 - Dominos
- Replies: 55
- Views: 31850
- Tue Aug 05, 2008 9:26 am
- Forum: Volume 114 (11400-11499)
- Topic: 11474 - Dying Tree
- Replies: 7
- Views: 5016
Re: 11474 - Dying Tree
You should set edge to 0. Your code fails when the first tree (only) can talk to a doctor.
- Tue Apr 15, 2008 8:09 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10397 - Connect the Campus
- Replies: 75
- Views: 38487
Re: 10397 Connect the Campus, WA????
used the union find algorithm.How?? What you have changed in the code?
- Tue Mar 25, 2008 3:01 am
- Forum: Volume 103 (10300-10399)
- Topic: 10397 - Connect the Campus
- Replies: 75
- Views: 38487
- Mon Mar 10, 2008 4:23 am
- Forum: Volume 112 (11200-11299)
- Topic: 11267 - The Hire-a-Coder Business Model
- Replies: 7
- Views: 4280
- Sun Mar 09, 2008 10:03 am
- Forum: Volume 110 (11000-11099)
- Topic: 11067 - Little Red Riding Hood
- Replies: 23
- Views: 10971
- Sun Mar 09, 2008 4:20 am
- Forum: Volume 110 (11000-11099)
- Topic: 11067 - Little Red Riding Hood
- Replies: 23
- Views: 10971
What's wrong with this:
it gave me WA
Code: Select all
AC
- Mon Mar 03, 2008 1:04 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11388 - GCD LCM
- Replies: 18
- Views: 13966
- Mon Mar 03, 2008 1:49 am
- Forum: Volume 113 (11300-11399)
- Topic: 11388 - GCD LCM
- Replies: 18
- Views: 13966
- Mon Mar 03, 2008 12:12 am
- Forum: Volume 113 (11300-11399)
- Topic: 11388 - GCD LCM
- Replies: 18
- Views: 13966
- Sun Mar 02, 2008 11:40 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11388 - GCD LCM
- Replies: 18
- Views: 13966
I'm trying to solve this problem but got WA
I'm using 2 nested loops for a & b, both loops starts from g & ends at l. I did some analysis & figured out that a & b must be in this interval [g, l]. the steps of the 2 loops is also g since I don't need to examine numbers that's not divisable by g. So ...
I'm using 2 nested loops for a & b, both loops starts from g & ends at l. I did some analysis & figured out that a & b must be in this interval [g, l]. the steps of the 2 loops is also g since I don't need to examine numbers that's not divisable by g. So ...
- Sat Mar 01, 2008 3:32 am
- Forum: Volume 3 (300-399)
- Topic: 336 - A Node Too Far
- Replies: 121
- Views: 58624
- Fri Feb 22, 2008 5:35 pm
- Forum: General
- Topic: New system is coming!
- Replies: 13
- Views: 9830
- Sun Jan 06, 2008 12:00 am
- Forum: Volume 1 (100-199)
- Topic: 112 - Tree Summing
- Replies: 137
- Views: 32281
- Wed Nov 28, 2007 11:06 pm
- Forum: Volume 7 (700-799)
- Topic: 762 - We Ship Cheap
- Replies: 51
- Views: 29425