KöMaL - Középiskolai Matematikai és Fizikai Lapok
 English
Információ
A lap
Pontverseny
Cikkek
Hírek
Fórum

Rendelje meg a KöMaL-t!

VersenyVizsga portál

Kísérletek.hu

Matematika oktatási portál

I. 220. Due to the varying hardness of the rocks, a tunnel boring machine could not exactly drive a horizontal tunnel as calculated. After the tunnel has been excavated, they measured at each meter the relative height of the floor and ceiling of the tunnel, compared to the originally planned base level. (Therefore, the base level has relative height 0 cm.)

In the first line of the file magassag.txt, downloadable from our webpage, you will find the number of measurements N (3\leN\le1000), then, in the following N lines the relative heights (in centimeters, between -100 and 600) of the floor and ceiling of the tunnel are found, compared to the base level.

95
0 511
-1 508
-3 507
0 510
1 511
...

You can interpret the data in the example as follows:

* data for 95 measurement points are stored;

* at the first measurement point, the boring machine achieved the exact lower height, and it created the upper height of the tunnel 511 cm above base level;

* at the third measurement point, for example, the machine dug 3 cm below the base level and created the tunnel ceiling 507 cm above the base level.

You should create a program alagut to solve the following tasks. (If a task requires displaying some data, the number of the actual task, e.g. Task #3, should also be written on the screen.)

1. Read data from the file magassag.txt and solve the following questions. If the file can not be read, use the first 10 lines of the source as input to solve the tasks.

2. Display on the screen the minimal inner height of the tunnel (understood to be the difference between ceiling height minus floor height relative to the base level).

3. In order to make the tunnel more regular, first the ceiling is made smoother. Beginning with the second measurement point and ending with the last but one, each ceiling height is averaged with the previous and succeeding ceiling heights. This average of 3 measurements is then rounded up to the nearest whole cm. If the average is higher than the actual ceiling height at that point, then the ceiling is excavated further, up to the average height. (If the average is not higher than the actual ceiling height, nothing happens.) Excavated soil drops down vertically to the floor (exactly at the actual measurement point), and increases the floor level (with exactly the same number of centimeters). When averaging ceiling heights at the next measurement point, this possibly modified new value will be used. You should display how many cm were excavated (provided that this number is greater than zero) from the ceiling at which measurement point. You should use a format like ``At measurement point #3, 1cm''.

4. Express in centimeters how much soil surplus or deficit is present altogether on the floor of the tunnel, relative to the base level.

5. In the next phase a road grader goes through the tunnel (in the original direction). This machine removes soil above the base level. The machine also stores excavated soil and takes it away. If the machine has enough stored soil in its containers, it spreads soil evenly where floor level is too low. If the machine carries no more soil, it leaves lower regions intact and continues with grading at the next measurement point, if necessary. The road grader is empty when it starts. You should write into file talaj.txt the floor level at each measurement point after the machine went through the tunnel once.

6. Display on the screen the beginning and ending measurement points corresponding to the lowest floor level (after the earthwork in the previous steps is done). If there are more than one pit with the same deepest depth, display only the first one. (The boundary of a pit is the first and last negative value.) If there are no negative values at all, display ``The floor is smooth.''

The source code (i220.pas, i220.cpp, ...) together with a short documentation (i220.txt, i220.pdf, ...) -- also describing which developer environment to use for compiling, further a brief description of your solution -- should be submitted in a compressed file (i220.zip). 3. 2.

(10 points)

Deadline expired on 10 November 2009.


Google Translation (Sorry, the solution is published in Hungarian only.)

Megoldásokról

Az érettségi típusú programozási feladatok más felépítésűek, mint a hagyományos I. feladatok. Összetettebbek, pontosabb utasításokat tartalmaznak és a legtöbb részfeladat egyszerű programozási tételekkel, mintákkal megoldhatók. A feladatok az átlagnál hosszabb szövegűek és bizony a szövegértést is mérik.

Többen nem tudták helyesen értelmezni a 3. részfeladat megoldásához szükséges „minden pontban mért magasságot a közvetlenül előtte és utána következővel átlagolják. A három értékből számolt átlagot felfelé kerekítik cm-es pontossággal” utasítást. Az átlagszámítás hibája egy-egy pontban lehet, hogy kicsi különbséget eredményez, de az egész alagútra nézve ez már nagy föld tömeg lesz.

Az 5. feladat megoldásánál típus hiba volt, hogy ha a gödröt megtalálták, akkor a gyaluban tárolt föld több volt-e, mint a gödör nagysága, vagy éppen kevesebb és így nem elegendő a feltöltéshez. Ennek a részfeladatnak az értelmezése jelentette a legnehezebb részét a teljes feladatnak.

Értékelési útmutató (alagutertekeles.pdf) , amelyet érdemes tanulmányozni a követelmények megértéséhez.

Mintamegoldás: alagut.dpr


Statistics on problem I. 220.
12 students sent a solution.
10 points:Barta 111 János, Szücs 092 Attila.
9 points:Balla Attila, Giczi Dániel, Horváth 135 Loránd, Paróczi Gergő, Szabó 928 Attila, Tölgyesi Ákos.
7 points:2 students.
6 points:1 student.
5 points:1 student.


  • Problems in Information Technology of KöMaL, October 2009

  • Támogatóink:   Ericsson   Cognex   Emberi Erőforrás Támogatáskezelő   Emberi Erőforrások Minisztériuma   Nemzeti Tehetség Program    
    MTA Energiatudományi Kutatóközpont   MTA Wigner Fizikai Kutatóközpont     Nemzeti
Kulturális Alap   ELTE   Morgan Stanley