FIT1045/FIT1053 Programming Competition
Registration
The registration requires the following two steps.
- Create an account at www.codeforces.com
- Fill out the Registration Form. The registration form must be filled in by logging in to your Monash account. If you cannot access the link due to permission issues, it indicates that you have logged in using your personal email address. In that case, open Google Chrome in incognito mode, log in to Monash account and then copy and paste the registration link there.
After you have registered for the competition, you will receive an invitation to join a private group at www.codeforces.com. You will see the contest in that group.
The email is sent manually so you may need to wait for a couple of days to get the invitation. Also, you will not receive an email for the invitation - you will need to login to www.codeforces.com to see the invitation . If you do not see the invitation after three days of completing registration, send an email to aamir.cheema@monash.edu with your codeforces handle/username.
Important: Participants who are found to have multiple registrations will be disqualified.
Schedule
Round | Start date | End date | Scoreboard |
Round 1 |
Friday 18:00:00, Week 3 |
Friday 18:00:00, Week 6 |
Scoreboard |
Round 2 |
Friday 18:00:00, Week 6 |
Friday 18:00:00, Week 9 |
Scoreboard |
Round 3 |
Friday 18:00:00, Week 9 |
Sunday 23:59:00, Week 11 |
Scoreboard |
Prizes
- The overall winner of the competition will receive a medal. The medal will be presented in lecture week 12.
- Top-5 contestants will receive commendation certificates (in lecture week 12).
Contest Rules
- This is an individual contest.
- Each round will have 3-6 problems and will accept submissions for at least one week.
- Python is the only allowed programming language for this contest.
Although www.codeforces.com will accept programs written in other languages, such submissions will be manually marked incorrect at the end of the round.
- Your output must exactly match the output format displayed in the problem description. The submissions are marked automatically by a program and your submission will be marked incorrect even if you miss/add whitespace. Therefore, before submitting your solution, make sure that it exactly follows the output format.
- The description of each problem also specifies a time limit and the submissions that fail to return the results within the time limit are marked incorrect and a timelimit exceeded error is returned.
- You must make sure that the program runs correctly and does not crash. Otherwise, your submission will be marked incorrect and a runtime error will be returned.
- Contestants are ranked according to the number of solved problems, with ties broken by penalty points.
Penalty points of a contestant is the number of incorrect submissions by the contestant for the problems that he/she has eventually successfully solved.
Penalty points do not apply on failed attempts for the problems unsolved by the contestants. E.g., if a contestant xyz solved problem A in 4 attempts
(including 3 failed attempts) and was unable to solve problem B (with 2 failed attempts), the penalty points will be 3 (the number of failed attempts for problem A).
- The winner will be the contestant with the highest score (the maximum number of problems solved). The ties will be broken by total number of penalty points. If there are more than one contestants with the same score and same penalty points, they will be officially ranked equal and their certificates will show them equally ranked. However, since we have only one medal, the medal will be given to the contestant who was able to achieve his final score the earliest. E.g.,
If the top contestants x and y both solved the same number of problems and have the same penalty points but x solved the last problem he/she solved in the final round before y solved his/her last problem, their certificates will show them both ranked first in the competition. However, the medal will be given to x.
- Important: The official scoreboard is displayed on this website. The scoring system used on www.codeforces.com does not apply to FIT1045/FIT1053 Programming competition because their scoring system
also considers the time took by the contestants to submit correct solutions.
Reading input and displaying output
Many beginners have difficulty understanding how to read input and generate output for the questions on www.codeforces.com. This is a guide to get you started on this. We will use the problem
Way Too Long Words in this guide. Carefully read this problem before you proceed.
The sample input for the program is given below:
4
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
The solution to the above problem is given below:
# read the first number and call it n
# IMPORTANT: Do not include any prompt, e.g., do not use n = int(input("Enter: "))
n = int(input())
for i in range(n): # since there will be n words, read them one by one
word = input()
answer = word
if len(word) > 10:
answer = word[0] + str(len(word)-2) + word[-1]
# Print the output. It must exactly follow the described output format including whitespaces
print(answer)
Copy the above code to a file say abbre.py. To test your program, run this in IDLE. It will wait for you to enter the input. Copy all lines of the input and paste in IDLE where it is waiting for your input.
If your program is correct, it should display you the sample output shown in the problem description. If there are any issues or errors, fix those. Once you are happy with your program,
submit your solution on the problem page Way Too Long Words. The program will be
tested on various test cases and, if your program is correct, "Accepted" will be displayed.
Below is a sample input for the problem Next Round .
8 5
10 9 8 7 7 7 5 5
For this problem, you need to read two lines. First line contains two integers (n and k) and the second line contains n integers. Below is a sample solution for this problem. Note how the input is read.
import math
# read the first line which consists of two numbers
line = input()
# Use the split function to split the line based on whitespace " "
line = line.split(" ")
# n is the first number. It needs to be converted to integer
n = int(line[0])
# k is the second number. It needs to be converted to integer
k = int(line[1])
# read the second line
line = input()
# split the line based on " "
line = line.split(" ")
count = 0
kth = 0
# we know there are exactly n numbers on the second line. access these one by one
for i in range(n):
# read each number
num = int(line[i])
# We only count if the score is greater than 0
if num > 0:
if i == k-1:
# kth stores the score of k-th ranked contestant
kth = num
if num >= kth:
count += 1
# print the output
print(count)
Copy the above code and save it as a file. Run the program in IDLE and copy and paste the sample input. It should display you the sample output given on the correct page. Once you are happy with
the program, submit it to www.codeforces.com and the online judging system will mark it. Once you are confident reading inputs, you may start attempting the questions in the round 1 (if it is already open). Otherwise, you may continue practicing
on www.codeforces.com.
How to practice
You are encouraged to practice as much as you can for the contest. In addition to
www.codeforces.com, below are some other websites for practice.
You may also join the weekly practice sessions organized by
Monash University Programming Team. For more details, contact me or Darcy Best at darcy DOT best AT Monash DOT EDU