IPSC 2009 - Problem D - Don't worry about wrong answers

# Internet Problem Solving Contest

## IPSC 2009
Problem D - Don't worry about wrong answers

- Easy input data set - D1
- Difficult input data set - D2

Every year many teams competing in the IPSC have huge penalty times due to lots of incorrect submissions – and also due to the fact that they failed to send us a nice postcard.

We know that many of the tasks are hard, with tricky cases, and try as you might, you just keep getting those WRONG ANSWER messages.

To make up for those bad feelings, in this task we decided to be extra nice to you. We will accept almost anything you submit for this problem!

And it gets even better. In this problem, if we somehow manage to disappoint you by a WRONG ANSWER message, we will try to make it up to you.

Scoring specification

For each of the data set D1 and D2 you do not solve, you score 0 points and gain 0 penalty minutes, as in all other tasks. Solving D1 is worth 1 point, solving D2 is worth 2 points, as in all other tasks.

The formula to calculate the penalty time is different. For this problem, the penalty time is calculated using the formula T + (-40) ⋅ R ⋅ D. Here T is the time in minutes when you submitted a correct solution, D in {1,2} is the difficulty of the data set, and R is the count of previously rejected submissions for that data set.

In words, for every wrong answer you make we decrease your penalty time by 40 minutes in D1 and by 80 minutes in D2.

Note that the submission limit still applies. (You are allowed to make at most 10 submissions for each particular data set.)

Problem specification

1. You submit a text file.
2. We look at its first line. If it contains anything other than a single integer, we will accept your submission.
3. If it does contain a single integer and you already submitted this integer before, we will accept your submission.
4. If we still did not accept your submission, we run the program we provide in the input file to decide whether to accept or reject your submission.

(A small technical detail: The program in d1.in may seem really slow, but don’t worry, our machine is really fast. Or maybe we are cheating and use a faster version of the same program, who knows.)

Input specification

The input file contains the source code of the program we will use to judge your submissions. The program is written in Python, which should make it readable to almost anyone.

Output specification

You may submit any text file the contest system allows you to submit.

Example

input
#!/usr/bin/python
import sys
def correct():
print("OK")
sys.exit(0)
def wrong_answer():
print("Wrong answer")
sys.exit(1)
# we already know that the first line contains a number, read it
N = int(sys.stdin.readline())
if N==47:
wrong_answer()
else:
correct()

output 42 is the answer to life, universe and everything. This is just one of very many inputs that would get accepted. This task is that easy!