Saint Louis University |
Computer Science 1300
|
Computer Science Department |
For this assignment, you must work individually in regard to the design and implementation of your project. The purpose of this particular assignment is to ensure that individuals are comfortable enough with the techniques we've learned thus far and able to apply those skills to a series of small challenges.
Please note the distinction made in our academic integrity policy between general course material and work that is submitted for this course. We consider the use of the Python language syntax in the category of general course material, which you may discuss freely. However, you must avoid any discussion of code that is specific to the particular problems that you must solve for this assignment. You should not receive direct help from others, nor should you share your own source code with others. See the complete policy on academic integrity for our course.
Rather than one large program, this assignment involves a series of smaller challenges. All of these are problems that were used as part of the ACM International Collegiate Programming Contest (ICPC) or similar such contests. (If you are interested in competing in the contest for SLU this November, let me know.)
Each problem is computational in nature, with the goal being to compute a specific output based on some input parameters. Each problem defines a clear and unambiguous form for the expected input and desired output. Relevant bounds on the size of the input are clearly specified. To be successful, the program must complete within a few seconds and produced EXACTLY the correct output.
Note well that while it typically makes sense for you to prompt a user when seeking input, you should NOT display any prompts when getting input for these problems, as those prompts will appear to be extraneous output. Just use the input() command without parameters, based on your knowledge of the expected input format.
For this assignment, we will be leveraging the Kattis system, which is used to administer many programming contests worldwide. They maintain an archive of many past problems at open.kattis.com. That system allows you to submit your own solutions to any of those problems, and have your solution graded for correctness against the judge's test set. That is, it must work not only on any sample inputs given as part of the problem description, but also on typically 20-40 additional inputs that the judge's have designed to test the correctness of an implementation.
To use the Kattis system, you must create a new account or log in linked to existing credentials in Facebook/Google/LinkedIn. While you are not required to use this system to complete this assignment, we strongly recommend that you do since it will let you see whether you are successful prior to submitting your work to me to be graded.
Note as well that even if you do use Kattis, I can't see the results you submit to that system. So as described below you must still explicitly submit all of your work to the git repository for this course so that I can grade it. Also, as discussed below, while the programming contest is graded simply that if you get the right answers you get full credit, I will be reviewing the style of your source code so please make sure it is well written, understandable, and commented where appropriate.
You are required to complete four of the following five problems. (If you do all five, submit for extra credit.)
Some advice about "The Easiest Problem is This One". It involves working with individual digits of integers. If you are careful, you might find the simplest way to get those digits is to work back and forth with str( ) and int( ) constructors and indexing. For example if I want the leftmost digit of an integer value named val, I could do int(str(val)[0]) as str(val) gives me the string representation of the integer, thus str(val)[0] the first character of that string representation, and then int( ) of that being the integer value of that digit. For example if val=293 then str(val) is '293', and str(val)[0] is '2' and of course int('2') is 2.
Alternatively, you could get the decimal digits without any reliance on strings. Numerically you can get the rightmost digit as val % 10 and then continue the process recurisvely on val // 10. That is 293 % 10 is 3 and then you could work with 293 // 10 which is 29 to continue processing the rest of the digits.
While you may have tested your code on the Kattis system, I don't have access to that. To receive credit for this assignment, you must explicitly submit all of your source code to me using our department's git repository. More specifically, we have created a folder named program03 in your repositiory and you should place the following files within:
readme.txt file that includes:
For further technical details about use of our department git server, see instructions here.
See as well a discussion of the late policy for programming assignments.
The assignment is worth 40 points, 10 points per problem. While you would likely get most of the points for a problem if you were successful on Kattis, I do reserve the right to review the style and legibility of your source code (while Kattis could care less about that). So please write your code in an understandable way and embedded comments are always most welcome!
Also, if you work on a problem but are not able to successfully get Kattis to accept your code, you should still submit it to the instructor so that your work can get graded; while you won't receive all 10 points for the problem, you could certainly get significant partial credit based on the quality of your attempt.
You are required to successfully complete four of the five contest problems for the required part of the assignment. If you are able to get all five successfully completed (and verified in Kattis), submit all five of your solutions for up to 4 points (i.e., 10%) of extra credit!