ArrayProblem code: DPC209 |
All submissions for this problem are available.
Array
You are given a 2D array, initially equal to 0. The next input line contains an integer with a Capital character H (Horizontal) or V (Vertical) or S (Square).
You have to read a input line and follow the following criteria:
- For every input, you have to start from the last row and first column of the array. Start moving upward until you find an appropriate position to set the input there. If you don t find a position in that column, then move to next column at the last row, and so on.
- If the input line contains 2H, then at the position where you find two horizontal elements containing 0, stop there and place 1 in those elements positions.
- If the input line contains 2V, then at the position where you find two vertical elements containing 0, stop there and place 1 in those elements positions.
- If the input line contains 2S, then at the position where you find two horizontal and two vertical (a square of two elements) elements containing 0, stop there and place 1 in those elements positions.
- If you cannot find a position that fits the given input, simply ignore that input.
Input
The first input line contains two integers i.e. the size of the 2D array. The maximum size of the 2D array will be 25x25. The next lines contain input to be set in the 2D array. The input will end on the line containing a single 0.
Sample Input
8 8
2H
2V
3S
2S
2H
3H
0
Sample Output
11000000
11000000
11100000
11100000
11100000
11110000
11100000
11000000
| Author: | rushikesh30 |
| Date Added: | 11-03-2010 |
| Time Limit: | 5 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments

Fetching successful submissions

Please register at
Please register at http://bit.ly/DSPPC2_Register to claim prizes and certificates.
My output is correct for the
My output is correct for the problem "Arrays" but it is giving wrong answer on submission. Can you give me some more sample inputs?
Admin: The aim of this
Admin: The aim of this contest is to promote programming and not to adjudge the best programmers. We request the participants to maintain a Healthy Competition. Any mal-practices if found will lead to Disqualification from the Series. If any such codes have been submitted consider submitting fresh codes.
The CodeChef Rankings are not
The CodeChef Rankings are not accepted Directly. Some Mal-Practices have been observed and Strict action would be taken.
LOL, another one. @ ALL: A
LOL, another one.
@ ALL: A sincere reason why this was dumbest contest ever.... as solutions are visible, please have a look at some submissions. Especially of those who have solved all problems of this contest.