Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old May 3rd, 2008, 3:37 PM   #11
Jimbo
Expert Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 706
Rep Power: 3 Jimbo is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

Sane - for the first one (beginner), what about int overflows? Since obviously we'll be using signed types for our input, will we need to check for the starting value + some subsequent operation overflowing from positive to negative? Also, is 1 considered prime?
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old May 3rd, 2008, 3:52 PM   #12
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,725
Rep Power: 5 Sane is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

Don't worry about int overflows for any of the questions. The only one you might need to worry about that for is the last question, but that depends entirely on how you do it.

From now on, assume whenever I'm talking about "integers" or "values", I'm talking about anything calculatable with a 32-bit signed integer. If you ever need to use a long long or anything larger than 32-bits, it will be clearly stated.

For the definition of a prime number, consult Wikipedia. I'll say nothing more, because half of the beginner challenge is just writing a proper prime function (of course, it can still be as slow as you wish).
Sane is offline   Reply With Quote
Old May 3rd, 2008, 5:12 PM   #13
Freaky Chris
Hobbyist Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 131
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

another question sane, silly one but. is 0 Positive, or niether positive or negative in the first challenge?
__________________
Who said i couldn't program
sarcasm = raw_input('Type in a sarcastic remark: ')
print sarcasm
Freaky Chris is offline   Reply With Quote
Old May 3rd, 2008, 5:26 PM   #14
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,725
Rep Power: 5 Sane is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

My goodness. How could I make such a mistake. It's supposed to be "non-negative". Not "positive". Good catch.

If someone just made the number sit there at zero, I would still give it to them. That would be the more clever interpretation. However, no, it should be non-negative.

I will fix that if I get editing abilities over my first post.
Sane is offline   Reply With Quote
Old May 4th, 2008, 12:46 AM   #15
Grich
Hobbyist Programmer
 
Grich's Avatar
 
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 137
Rep Power: 1 Grich is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

I see the challenge is set up. I would have replied alot sooner, but I was at work. As soon as my college assignment is done, I'll start it. Thanks alot Sane.
__________________
SYNTAX ERROR ...
Grich is offline   Reply With Quote
Old May 4th, 2008, 5:23 AM   #16
Freaky Chris
Hobbyist Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 131
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

well i've completed or at least i think i have the first algorithm. So i though since i didn't have too much trouble with that one i would take a crack at the junior one. Im getting a bit frustrated with it though, as for some reason it appears to work perfectly for odd values of K but not even lol.

Chris
__________________
Who said i couldn't program
sarcasm = raw_input('Type in a sarcastic remark: ')
print sarcasm
Freaky Chris is offline   Reply With Quote
Old May 4th, 2008, 11:05 AM   #17
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,725
Rep Power: 5 Sane is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

Sweet, have fun Grich.

Chris, "Junior" is kind of a misleading name for it, since it's not exactly for a junior programmer. But from a quick glance at your submission, it looks like you found it easy. I do see at least one small problem, but I'm not helping out that much.

P.S. For those who can do Junior, they should at least be able to tackle part marks on the Senior by getting it to work for n < 20.
Sane is offline   Reply With Quote
Old May 4th, 2008, 7:13 PM   #18
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,602
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

I added the pdf to the first post.

I will take a look at it in a little while and give them a go.
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old May 5th, 2008, 5:06 AM   #19
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,725
Rep Power: 5 Sane is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

Thanks.

Interesting. Python seems to be the most popular choice so far.
Sane is offline   Reply With Quote
Old May 5th, 2008, 5:39 AM   #20
mbd
Programmer
 
Join Date: Nov 2007
Posts: 75
Rep Power: 1 mbd is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

do you have any more test cases for the hurdles problem
mbd 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
Sorting algorithms problem....... MicDareall Python 11 Apr 19th, 2006 2:48 PM
Sorting Algorithms 6431hoho Coder's Corner Lounge 9 Feb 28th, 2006 6:57 AM
Challenge: How to make daily life better with programming? tempest Coder's Corner Lounge 53 Jun 17th, 2005 2:37 AM
Uman's WEEKEND CHALLENGE uman Coder's Corner Lounge 25 Jun 6th, 2005 9:49 PM
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 3:56 PM.

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