Problem Set & Online Judge


Tasks - Volume 9 (Pre-ONI Contest)

Read the following lines carefully

Introduction

Hi and welcome to the Pre-ONI Programming Contest 2nd edition!

This contest was organized by myself with the help of some people who created programming tasks. This year the ones that helped are:

Vlad Dascalu - student - first year at Politehnica Bucuresti

Ionut Fechete - 10th grade at Spiru Haret - Suceava.

Stefanita Fechete - student - first year at Politehnica Bucuresti

If you have questions about the tasks, mail them to the guy who created the program. Vlad's address is jocuri@softhome.net and Ionut's address is f_dany@eminem.com. My mail is addictedtoprogramming@yahoo.com. Stefan's address is f_steff23@yahoo.com.

Some rules

The rules to this contest are very simple. You are given some programming tasks and you have to solve them using C or C++ or Pascal. You have to create only one source file pertask. Your solutions will be compiled using gcc,g++ or fpc under Linux. They will be run against a series of test cases and will be scored acordingly. Each task is worth 100 points.

If the source code doesn't compile, you get 0 points for that tasks. Else each correctly solved test case will be worth 100/N points, where N is the number of test cases used. To correctly solve a test case, your program will have to finish with exit status 0 before the time limit and will have to output at the standard output the correct answer. If these conditions are not met, you get 0 points for a test case.

This is an ONI preparation contest. There is no point in cheating. For the contest to be fair, you should not use anything but your brain and your compiler's help system to solve a task. Also note that the contest will be open for an entire day (from wednesday 6p.m. GMT+2 to tuesday 6.p.m. GMT+2) in order to have as many people as possible participating.

However, you should only devote as much as 6 hours to solving the tasks. This should be enough to solve all the tasks. However, I can't stop you from using more time is you want.

How to send the solutions (QUITE IMPORTANT)

For each task, you have to write one source file. The file should be named after the problem's ID and its extention should be one of .c for C language, .cc for C++ language or .p for Pascal. The task IDs begin with 19001 and end with 19008. Put all the source codes in a .zip archive (not .ace, not .rar but .zip).

To send the solution write me a mail at addictedtoprogramming@yahoo.com. The subject line should be "contest" and inside the message you should write your name and anything else you think I should know. Don't forget to attach the .zip file. The entire .zip file should be no longer than 30KB. If it is bigger or it isn't .zip, I will delete it and you won't get graded. Please attach the file in binary mode. I don't feel like uudecoding files.

Some more details (IMPORTANT)

Please note that all the tasks read input from stdin and write to stdout. Your program is not allowed to open any other file. If it does, you will be disqualified. You are not allowed to write anything to stderr -- make sure you disable debugging output before sending the solution.

If you write a program that tries to undermine system security you will get disqualified and added to the shame list.

The programs will be compiled using the following command lines:

for C: gcc -O2 -static -o output sourcecode

for C++: g++ -O2 -static -o output sourcecode

for Pascal: fpc -Xs -O2 -o output sourcecode // hopefully this is correct

Final hints (VERY IMPORTANT)

The grading machine is a 1Ghz Athlon running RH Linux 8. gcc is version 3.2. fpc is version 1.0.6. The timelimit in each task is for the realtime -- but no other processes will be run at the same time.

Before sending the solutions, make sure your source code compiles and that it doesn't do anything stoopid like writing extra debugging output, waiting for a keystroke, reading/writing to other files.

Make sure your program uses only as much memory as allowed (the limit is different for each task and written in each task text).

If everything goes fine, the results will be displayed on tuesday, 7p.m GMT+2, an hour after the contest is over.

If I left something out or you would like to say something to me, feel free to contact me at addictedtoprogramming@yahoo.com. However, don't flame me or something because I hate that.

Good luck and have as much fun as possible.

19001 - Amax in 3D

19002 - Spoiled Brat

19003 - 3x3

19004 - Function

19005 - Impas

19006 - Tester

19007 - Find the map

19008 - John

1