![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Expert Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 706
Rep Power: 3
![]() |
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> |
|
|
|
|
|
#12 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,725
Rep Power: 5
![]() |
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). |
|
|
|
|
|
#13 |
|
Hobbyist Programmer
|
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: ')
|
|
|
|
|
|
#14 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,725
Rep Power: 5
![]() |
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. |
|
|
|
|
|
#15 |
|
Hobbyist Programmer
Join Date: Sep 2007
Location: Sydney - Australia
Posts: 137
Rep Power: 1
![]() |
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 ... |
|
|
|
|
|
#16 |
|
Hobbyist Programmer
|
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: ')
|
|
|
|
|
|
#17 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,725
Rep Power: 5
![]() |
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. |
|
|
|
|
|
#18 |
|
PFO Founder
![]() ![]() |
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. |
|
|
|
|
|
#19 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,725
Rep Power: 5
![]() |
Re: Sane's Monthly Algorithms Challenge #1 [05-08]
Thanks.
Interesting. Python seems to be the most popular choice so far. |
|
|
|
|
|
#20 |
|
Programmer
Join Date: Nov 2007
Posts: 75
Rep Power: 1
![]() |
Re: Sane's Monthly Algorithms Challenge #1 [05-08]
do you have any more test cases for the hurdles problem
|
|
|
|
![]() |
| 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 |
| 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 |