Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 8th, 2008, 1:21 PM   #31
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Quote:
Originally Posted by Sane View Post
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).
Right. To draw out that segment of the graph, so people can see, here's what it looks like:
10<---9
|     ^
|     |
----->4
      ^
      |
      3
----------
rest of the graph
Changing the 10 to go to the 3 eliminates the loop which is otherwise cut off from the rest of the graph.
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old Jun 8th, 2008, 1:27 PM   #32
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Good stuff.

You guys might kick yourself when you see the solution. I have a feeling you guys might be over-complicating it now. lol. Have you figured it out Jimbo?
Sane is online now   Reply With Quote
Old Jun 8th, 2008, 1:29 PM   #33
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Quote:
Originally Posted by Sane View Post
You guys might kick yourself when you see the solution. lol. Have you figured it out Jimbo?
I'll admit, I cheated. The problem sounded so familiar I poked open my algorithms book. I think I'll pass on submitting that problem now
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old Jun 8th, 2008, 1:34 PM   #34
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Awe, dang. I'm actually kind of surprised it was in there... It's a generic problem, but I've never seen this version of it before.

Since I didn't cover all my bases, I don't consider it cheating if you've found the same problem elsewhere. It's my fault that it's been done before. Nothing in the rules against looking at textbooks.

I'm also wondering if their solution is the same as mine, since it's again not something I've learned from a textbook, but had to think up. So as long as you didn't copy their code, you should go ahead and submit it.
Sane is online now   Reply With Quote
Old Jun 8th, 2008, 2:36 PM   #35
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 843
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

I didn't realize that loops caused problems in the senior (escalator) problem, so it turns out my current solution is O(E*V). I can't see any way to do it in O(E)... hint?
titaniumdecoy is offline   Reply With Quote
Old Jun 8th, 2008, 2:43 PM   #36
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

So worst case it's 100^3 operations? Then don't worry about it. That's the expected solution. The best possible solution is |E|+|V| (I was writing it as just |E| earlier), but that's needlessly quick (and will be explained in the solution thread).
Sane is online now   Reply With Quote
Old Jun 8th, 2008, 7:10 PM   #37
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 843
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

I just thought I would point out that the submission deadline is June 31, but June has only 30 days.

Also I found the advanced problem much, much easier than the senior problem. Assuming I got it right, that is.
titaniumdecoy is offline   Reply With Quote
Old Jun 8th, 2008, 8:05 PM   #38
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Quote:
Originally Posted by titaniumdecoy View Post
I just thought I would point out that the submission deadline is June 31, but June has only 30 days.
Okay. I've scored titanium's submissions, and he's got a zero.

Anyone else notice any incredibly stupid mistakes?
Sane is online now   Reply With Quote
Old Jun 25th, 2008, 1:07 PM   #39
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,840
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Just a small reminder: 5 days left!
Sane is online now   Reply With Quote
Old Jun 25th, 2008, 6:59 PM   #40
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 256
Rep Power: 2 Jabo is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Quote:
Originally Posted by Sane View Post
Anyone else notice any incredibly stupid mistakes?

Sane has the makings of an IT Director...
Jabo is offline   Reply With Quote
Reply

Bookmarks

Tags
algorithms contest, programming challenges

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC