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

KöMaL Problems in Informatics, April 2006

Please read the rules of the competition.


Show/hide problems of signs:


Problems with sign 'I'

Deadline expired on May 15, 2006.


I. 130. Write your program to find anagrams in a given text. An anagram of a word is formed by rearranging its letters arbitrarily, as in earth and heart.

The name of the input and output text file is specified as the first and second parameter: for example, if we want to collect all anagrams of text.txt into anagrams.txt, then the following command is issued

i130.exe text.txt anagrams.txt

The input file contains at most 1000 words in some lines and separated by spaces. Each word has at most 30 letters without any special characters. Lower and upper case letters are considered the same.

Each line of the output file should contain a group of anagrams separated by spaces. The words are listed in alphabetic order in each group, and groups containing more words come first.

See the example.

The source code (i130.pas, i130.cpp, ...) is to be submitted.

(10 pont)

solution (in Hungarian), statistics


I. 131. Make an HTML page describing the counties of Hungary (or your country). The page should consist of two frames separated horizontally. The upper frame should contain a schematic map showing counties in different colours. If one clicks on a county, some information on it (e.g. name, area, population) should appear in the lower frame.

The file index.html should contain the definition of the frames. Texts appearing in the frames should be contained in other HTML files. All files should be packed into one ZIP file.

The ZIP file (i131.zip) should be submitted.

(10 pont)

statistics


I. 132. An SQL database is used to maintain data of a secondary school contest of informatics. The results are also published on the Internet, where answers to the following questions are available.

  1. Display for each problem its number, text and the maximal number points that can be earned.

  2. Compute the average number of points earned by the contestants.

  3. List the distribution of points for Problem 4, similarly to the statistics of KöMaL problems.

  4. List the points earned by ``John Smith'' for each problem.

  5. Determine the number of contestants from each school.

  6. List contestants from a particular secondary school.

  7. Make the final table of results containing the name of contestants, their schools, classes, total number of points awarded. They should be ranked in descending order according to awarded points. (If two numbers are equal, list alphabetically.)

Tables of the database are to be constructed in such a way that one SQL query should be enough in each case. You should also give these queries.

The definition of the database tables and the seven SQL queries should be submitted in plain text (i132.sql, i132.txt).

(10 pont)

statistics


Problems with sign 'S'

Deadline expired on May 15, 2006.


S. 17. Write a program that plays the following word game. A list of words (at most 20) is read from the standard input, one word per line and ending in an empty line. Your program should display two sentences in two lines on the standard output, consisting of the given words in such an order that concatenation of words of the two sentences should yield the same string, with the very first letter being the only possible exception. The number of occurrences of a given word in the output should be equal to that of in the input list. It is of course ignored whether the solution conveys a meaning or not. If there is no solution, print ``No solution''.

See the examples (that even make sense in Hungarian).

The source code (s17.pas, s17.cpp, ...) and the documentation of your program should be submitted.

(10 pont)

statistics


$Var(Body)

Upload your solutions above