Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Jul 1st, 2008, 2:19 PM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Sane's Monthly Algorithms Challenge #3 [07-08]

The SMAC Challenge is back again for a third time. The number of submissions has increased since the first month, along with the number of people completing the most challenging problems. I hope to see this trend continue into the summer.

I've designed 4 programming challenges ranging from beginner to advanced difficulty.

Beginner and Junior are for those who haven't had much experience with contest-style challenges, but can still think logically and write recursive and algorithmic code.

Senior and Advanced are for those experienced with writing more complicated algorithms.

Guru will be the trickiest difficulty level which will measure up to the tough IOI and ACM problems. I have not included one in this problem set.

--------------
If you want some practice and exposure to the types of programming challenges you will see here, along with data to test your solutions, please have a look at some of the previous SMAC challenges here at PFO.
--------------

But even for any difficulty, it will be challenging to attain 100%. You must make your solution work for every possible test file. And these test files will not be revealed until after the competition. So test your code inside and out until then.

Please read every rule. The challenges have been attached to the bottom of this post. Submission deadline is July 31, 2008.

At the end of the month, the best solutions, winners, test data, results, statistics, and explanations of all challenges will be posted in separate threads.

The ultimate goals of SMAC are to increase enthusiasm about problem solving and algorithms in computer science, to challenge even the most experienced coders, to increase community involvement in PFO, and to have fun.

Thanks and good luck to all who participate!


-----------------------------------------------------------------------------------

Rules and General Information

1) Do not post or share any solutions!

2) You may ask questions and give simple hints and tips in the thread provided each month.

3) Input is always in the format specified in the problem, and will be read from the specified file (for example, “cipher.in”). Output is written to the specified file (for example, “cipher.out”).

4) You may use any language, but only C/C++/Java/Python will be graded by me (see rule 9).

5) Each solution must take no more than 10 seconds to execute. Also, your program must never use more than 64 MB of stack space (unless otherwise specified). These constraints should only be considered for Senior and Advanced level problems.

6) E-mail your submissions to dr.sane@gmail.com with “SMAC” in the subject line before the submission deadline. Also make sure to include your PFO handle!

7) You have a month to write your solutions, and submissions are only made final after the deadline cutoff. Before then, if you would like to update your submission, just make sure you e-mail it to me and let me know.

8) It is recommended that you start at “Beginner” to familiarize yourself with the problems, and then work your way up. Even the most experienced programmers may find the last problem(s) very challenging.

9) Sometime after the deadline, results will be publicly posted showing how well each program performed on larger and more tricky data files (not the given sample data). Also, solutions and an analysis of each problem will be given. If your program was not written in C/C++/Java/Python, I will not be able to grade your submission. In this case, I will give you the test files and expect you to report back with your own score within the next couple days.

10) Every solution’s score will be based solely on its ability to solve the unknown test files. Points are awarded for every perfectly matching output file. No points are awarded for clarity, style, presentation, or execution speed (within the allotted time).

11) Don’t take the results (or expectations) of these challenges seriously. The point of this is to learn and have fun. If you would like me to refrain from posting your results or solutions in the analysis thread after the contest, please specify that in your submitted e-mail(s). Good luck and happy coding!

Submission Deadline: July 31
Attached Files
File Type: pdf SMAC_3_July.pdf (125.7 KB, 42 views)
Sane is offline   Reply With Quote
Old Jul 1st, 2008, 7:33 PM   #2
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

for the Stocks problem, are you looking for the maximum profit single transaction?
OpenLoop is offline   Reply With Quote
Old Jul 1st, 2008, 8:08 PM   #3
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 #3 [07-08]

Preceeding OpenLoop's question, are you only buying a total of 1000 shares during the day? Or can you only have 1000 at a time? If the former, then the problem seems to end up as OpenLoop asked...
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old Jul 1st, 2008, 10:46 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

A total of 1000 shares bought during the day. So a single-transaction. Or else the question would be much too difficult for Junior. The question is already pretty difficult if n=1,000,000.
Sane is offline   Reply With Quote
Old Jul 1st, 2008, 11:26 PM   #5
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 641
Rep Power: 4 Jessehk is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

There is a particular algorithm that Boost offers that would really help in the Junior class. Do you have Boost installed?

EDIT: Nevermind; ignore the question. I'll keep my post intact for clarity, though.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Jul 1st, 2008, 11:34 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

External libraries aren't allowed, mostly because it's already time consuming enough for me to do all of this. Sorry.
Sane is offline   Reply With Quote
Old Jul 2nd, 2008, 5:27 PM   #7
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 641
Rep Power: 4 Jessehk is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

Anyone want to share test cases (pipe maps) for the advanced problem?
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Jul 2nd, 2008, 5:49 PM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

For senior? Yes, I've got one for you. Hopefully it is not too detailed.

20 20
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
********************
Sane is offline   Reply With Quote
Old Jul 2nd, 2008, 5:53 PM   #9
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 641
Rep Power: 4 Jessehk is on a distinguished road
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

Quote:
Originally Posted by Sane View Post
For senior? Yes, I've got one for you. Hopefully it is not too detailed.
I was so proud that I had a working algorithm and now you've gone and crushed my spirits.

Are we supposed to be able to handle that?
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Jul 2nd, 2008, 6:03 PM   #10
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,835
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Sane's Monthly Algorithms Challenge #3 [07-08]

It's important to read everything, especially the "notes".

Quote:
Note: It can not be guaranteed that there will be less than 10^9 different ways for water to reach the bottom-right corner.
Your solution will get almost everything, but you will need to change something (do some Wikipedia'ing and perhaps reading of #2 SMAC solutions) to get it all.

--------------

Note To All Seniors:

I realized there's an ambiguity in Senior. The answer should be the number of spaces the water visits. Not the number of pipes it travels through. This is because it does not need to travel through the bottom-right pipe. In fact, there does not even need to be a pipe in the bottom-right corner (water just needs to be able to get there). The sample test data is still correct, but the correction is "number of spaces" as opposed to "number of pipes" for clarity since the water doesn't need to go anywhere once it gets to the bottom-right space.

Last edited by Sane; Jul 2nd, 2008 at 6:20 PM.
Sane 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
Cipher Challenge School Project Alfredog4 C++ 7 Jul 29th, 2008 12:04 AM
Sane's Monthly Algorithms Challenge #2 [06-08] Sane Software Design and Algorithms 42 Jul 1st, 2008 10:33 AM
Sane's Monthly Algorithms Challenge #1 [05-08] Sane Software Design and Algorithms 31 May 21st, 2008 10:11 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:34 AM.

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