10397 - Connect the Campus

All about problems in Volume 103. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Dmytro Chernysh
Experienced poster
Posts: 146
Joined: Sat Apr 26, 2003 2:51 am

Post by Dmytro Chernysh » Wed Jun 25, 2003 7:34 pm

Do you know that QuickSort is the fastest only in avarege, but there are cases where OuickSort is VERY slow! :-)

If you are interested in that I can write more...

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski » Thu Jun 26, 2003 7:55 am

Yes but in this question buit-in qsort() in C library is enough ....
Pesymistic time complexity QuickSort and ShellSort is the same, but qsort() in average time is very efficient ... and I don't think, that judge create tests, on which qsort is problem ;-)

Best regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Wed Jul 02, 2003 4:27 am

-- Post removed by Observer --
Last edited by Observer on Fri Jan 13, 2006 6:24 pm, edited 2 times in total.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Thu Jul 17, 2003 10:41 am

No one can help me..... weep :cry: :cry: :cry:
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

anupam
A great helper
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm
Contact:

Post by anupam » Fri Jul 18, 2003 2:43 pm

well i am also a sufferer, does the picture f the problem indicate anything important, If it does they please post the picture here. Because it is not available in the site..;
Please post the pictures. :oops: :oops:
"Everything should be made simple, but not always simpler"

titid_gede
Experienced poster
Posts: 187
Joined: Wed Dec 11, 2002 2:03 pm
Location: Mount Papandayan, Garut

Post by titid_gede » Fri Jul 18, 2003 3:15 pm

i used code 10147 to solve this problem. only changed input / output. this is MST problem.
Kalo mau kaya, buat apa sekolah?

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Sat Jul 19, 2003 4:38 pm

-- Post removed by Observer --
Last edited by Observer on Fri Jan 13, 2006 6:25 pm, edited 1 time in total.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

dispanser
New poster
Posts: 18
Joined: Wed May 01, 2002 4:12 pm
Location: Jena/Germany
Contact:

Post by dispanser » Wed Jul 23, 2003 9:25 am

anupam wrote:well i am also a sufferer, does the picture f the problem indicate anything important, If it does they please post the picture here. Because it is not available in the site..;
Please post the pictures. :oops: :oops:
the picture is absolutely not important. you can see a few buildings from far away, that symbolizes the campus ;).

btw, can anyone tell me in what online contest the problem occured? i remember i have solved it, but i can't find the source :-(

Thomas

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Fri Jul 25, 2003 5:26 pm

Hello???!!! Still haven't got any assistance.... :( :cry:
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

titid_gede
Experienced poster
Posts: 187
Joined: Wed Dec 11, 2002 2:03 pm
Location: Mount Papandayan, Garut

Post by titid_gede » Fri Jul 25, 2003 5:57 pm

i have no idea.. since i'm pretty sure that if you got AC in highways you will get AC in connect to campus. have you check your input / output?
do you mind if you post your full source code?
Kalo mau kaya, buat apa sekolah?

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Sat Jul 26, 2003 4:19 am

-- Post removed by Observer --
Last edited by Observer on Fri Jan 13, 2006 6:19 pm, edited 7 times in total.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Thu Jul 31, 2003 9:23 am

-- Post removed by Observer --
Last edited by Observer on Fri Jan 13, 2006 6:20 pm, edited 1 time in total.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Wed Aug 06, 2003 12:58 pm

Hello??!?! Why no-one can help me...... :cry: :cry:
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Wed Aug 06, 2003 1:32 pm

Dear Observer,

Please don't yell at us if we don't reply to your posts.

If you get no reply it can have several reasons:
- people don't know the answer;
- people don't care to answer;
- people can't understand your code.

The last reason applies to me. Your code is very hard to understand because you don't give comments, you use cryptic one-letter variable names, your indentation is weird, and last of all, you only give us part of it.
Publish your full code (like titid_gede asked), or PM it to me, and I'll have a go at it. My Pascal solution is AC, so I might find your bugs.

-little joey

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Wed Aug 06, 2003 4:34 pm

Excuse me, but you can't say something is weird only because it's different from the ones you use!!!

Explanation of variable names:
i, j, k, p, q are just loop counters or dummy variables;
tt : store the total length;
xc, yc : store the coordinates of the "nodes"
the use of other variables should be obvious... :D

I leave out the function declaration part because I'm pretty sure that it's correct. I deliberately cut it off to shorten your time to read my code (I've applied the sorting function in hundreds of other programs, and they proved that my sorting code is flawless...).

Comments are omitted, because most of the users here know Kruskal's algorithm quite well. But if you think they're useful, I'll try to add some...

P.S. Since I applied this MST code in some other occasions and got ACC (esp. 10147 Highways), the most possible error in my code is input/output I think. Is my eof statement wrong? Or are there any other i/o bugs?
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

Post Reply

Return to “Volume 103 (10300-10399)”