Cities in Alberta tend to be laid out as rectangular grids of blocks. Blocks are labeled with coordinates
The quality of living in each particular block has been ranked by a distinct number, called quality rank, between
The city planning department wishes to identify a rectangular set of blocks with dimensions
You are to implement a procedure rectangle(R,C,H,W,Q) where
Your implementation of rectangle must return a number: the best (numerically smallest) possible median quality rank of an
Each test run will only call rectangle once.
Example 1
R=5, C=5, H=3, W=3, Q= 5 11 12 16 25 17 18 2 7 10 4 23 20 3 1 24 21 19 14 9 6 22 8 13 15
For this example, the best (numerically smallest) median quality rank of
rectangle(R,C,H,W,Q)=9
Example 2
R=2, C=6, H=1, W=5, Q= 6 1 2 11 7 5 9 3 4 10 12 8
For this example the correct answer is
Subtask 1 [20 points]
Assume
Subtask 2 [20 points]
Assume
Subtask 3 [20 points]
Assume
Subtask 4 [20 points]
Assume
Subtask 5 [20 points]
Assume
Implementation Details
- Implementation folder:
/home/ioi2010-contestant/quality/
(prototype: quality.zip) - To be implemented by contestant:
quality.c
orquality.cpp
orquality.pas
- Contestant interface:
quality.h
orquality.pas
- Grader interface: none
- Sample grader:
grader.c
orgrader.cpp
orgrader.pas
- Sample grader input:
grader.in.1
grader.in.2
etc.
Note: The first line of input contains: The following lines contain the elements of , in row-major order. - Expected output for sample grader input:
grader.expect.1
grader.expect.2
etc.
Comments
how do you test this on your own computer? What is the command exactly??
For anyone getting CE, the exact function signature is: