Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?

KöMaL Problems in Informatics, May 2006

Please read the rules of the competition.


Show/hide problems of signs:


Problems with sign 'I'

Deadline expired on June 15, 2006.


I. 133. Write a program to classify closed planar polygons. A polygon is given with its vertices; first the number of vertices is given, then two coordinates of each vertex in each line are specified. Your program should decide whether the polygon has positive or negative orientation, or it is self-intersecting. (This latter case should also include polygons with some coinciding vertices or when a vertex lies on the interior of another side.)

Examples:

The source code (i133.pas, i133.cpp, \ldots) is to be submitted.

(10 pont)

solution (in Hungarian), statistics


I. 134. Using HTML and JavaScript tools, implement a web-based equation editor that can handle TeX commands of the internet forum (or the electronic worksheets) of the Journal KöMaL.

Your web page should consist of two parts. The lower part should be a web form of POST type, containing a textbox and an OK button. Upon pressing the button, the browser should send the following data to http://www.komal.hu/forum/forum.cgi

Variable  value
a         tk
src       content of the textbox

The upper part of your page should contain some buttons or drop down menus with the most important TeX commands, at least 8 of them (for example, fraction, lower and upper index, sum, Greek letters) similarly to a WYSIWYG equation editor. If the user presses a button, your program should insert the corresponding TeX command and the necessary braces into the textbox at the actual position. For example, if one presses the fraction sign, a ''\frac{ }{ }'' command should appear with the cursor positioned between the first braces.

When evaluating solutions, we will take into account the tools applied, some aesthetical aspects and whether your program operates well under different browsers (Internet Explorer, Mozilla, Opera etc.).

The source code (i134.html) should be submitted.

(10 pont)

statistics


I. 135. An SQL database is used to maintain data concerning summer camps of a secondary school. Different camp terms have different starting and ending dates. The amount of money to be paid by teachers and students is also different. Upon request of the headmaster, the following questions (among others) should be answered:

1. List the name of camp terms, their dates, and number of boy, girl and teacher participants.

2. List the boys participating in the third camp.

3. Count how many students and teachers will be present in the camp on August 5.

4. Determine for each term the total amount of money already paid by the participants.

5. Determine for each term the amount of money students still owe.

6. List for each student the amount of money already paid along with the additional amount that needs to be paid.

You should construct tables of the database in such a way that one SQL query (without any subqueries) should be enough in each case. You should also give these queries.

The definition of the database tables and the six SQL queries should be submitted in plain text files (i135def.txt, i135quer.txt).

(10 pont)

statistics


Problems with sign 'S'

Deadline expired on June 15, 2006.


S. 18. A large binary data file contains at least 200 million, 8-byte floating point numbers. Write a program to sort these numbers into ascending order and write them back into the file. At most 50 megabytes of memory can be used, and only the original file can be opened. Its size can not be altered. The required running time (depending on the size of the file) is about a few minutes.

The name of the data file is given in the command line, for example, issuing

s18.exe adatok.dat

should sort the file data.dat.

The source code and documentation of your program (s18.pas, s18.cpp,\ldots) should be submitted.

(10 pont)

statistics


$Var(Body)

Upload your solutions above