![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Programming Guru
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
If I recall correctly, the solution you sent me was a double for loop. So it was
By the way, here's a hint for your #3: Try feeding your solution a graph with two disjoint sets. |
|
|
|
|
|
#22 | |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Quote:
I'm curious about the
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
|
#23 |
|
Programming Guru
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Fancy in terms of elegance. Yes. Since it's literally 3 lines long.
I've been ignoring the +|V| part in the notation. mbd's solution is truly
__________________
Waterloo's Canadian Computing Competition (CCC) - Stage 2 Problems, Solutions, and Test Data Last edited by Sane; Jun 7th, 2008 at 3:45 PM. |
|
|
|
|
|
#24 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
So, just to fire up more controversy in this thread, here's my approximation of my solutions' time efficiency (note: I wasn't doing a whole lot of optimizing for space):
Beginner: Junior: Senior: Advanced: I will note that I didn't do very extensive testing (ironic, for being a tester), but I'm pretty sure I've covered almost all of the cases (assuming my implementation is bug-free, haha!
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#25 |
|
Expert Programmer
|
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
I have come up with what I believe is a working solution to the senior (escalator) problem. It is recursive and, as far as I can tell, runs in
If you have solved the senior (escalator) problem, is your solution recursive? EDIT: Thanks Jimbo, got here in time to change "junior" to "senior". EDIT: Changed running time from O(E+V) to O(E) Last edited by titaniumdecoy; Jun 7th, 2008 at 11:51 PM. |
|
|
|
|
|
#26 | |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Quote:
![]() I solved everything with loops, for comparison, but really they can probably be written both ways.
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
|
#27 |
|
Expert Programmer
|
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Does anyone have (a) large test case(s) for the senior (escalator) problem? It's a hassle to draw one out on paper and then figure out if it passes.
|
|
|
|
|
|
#28 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Crap, I drew one out and found a case I'd forgot to cover. Back to the hacking board...
10 14 1 3 1 7 1 8 2 3 3 5 3 4 4 9 5 7 5 6 6 1 7 2 8 2 9 10 10 4
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#29 |
|
Expert Programmer
|
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Mrh. Looks like my solution doesn't work... or does it? This is going to take time...
![]() Last edited by titaniumdecoy; Jun 8th, 2008 at 12:27 AM. |
|
|
|
|
|
#30 |
|
Programming Guru
![]() |
Re: Sane's Monthly Algorithms Challenge #2 [06-08]
Don't worry about being super-duper efficient if you're not completely sure that the logic is correct. The number of floors is quite small, so keep it simple! It's better to be a bit slower and have it perfect, than trying to nail the fastest possible solution and getting it wrong.
I'm happy to hear people talking out the harder problems this month. Instead of what happened last month. lol. P.S. For the sake of those testing Senior, with the test file Jimbo posted, my solution says that Bob gets fired. But that changes as soon as I change the last line from (10 4) to (10 3). |
|
|
|
![]() |
| Bookmarks |
| Tags |
| algorithms contest, programming challenges |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Uman's WEEKEND CHALLENGE | uman | Coder's Corner Lounge | 34 | Aug 5th, 2008 9:25 PM |
| Sane's Monthly Algorithms Challenge #1 [05-08] | Sane | Software Design and Algorithms | 31 | May 21st, 2008 10:11 PM |
| Good reference/tutorial for game tree algorithms | Jessehk | Software Design and Algorithms | 10 | Apr 10th, 2007 11:32 AM |
| Challenge: How to make daily life better with programming? | tempest | Coder's Corner Lounge | 53 | Jun 17th, 2005 2:37 AM |
| Weekend Challenge | theduck | Community Announcements and Feedback | 43 | Jun 3rd, 2005 4:58 PM |