HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN254 PRE1B > problem:


1. 51084 - Reflect a matrix

CEN254 PRE1B

Start: Apr.04.2017 at 01:18:00 PM
Finish: Apr.04.2017 at 02:25:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (2)

Contest problems

• 1. 51084 - Reflect a matrix
• 2. 51085 - xyx Divisible by k

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Reflect a matrix

Question: For a course you are required to reflect the given matrix in the given dimension. There is Horizontal (H) and Vertical (V). Write a program that reads a 2D array and the dimension to reflect, then show the new array.

Input specification: Firstly, you will be given two integers (r and c) size of 2D array. Then, you will be given c integers in the following n lines.On the next line, you will be given an integer k; then k chars (V or H) where 1 ≤ (r and c) ≤ 100; 1 ≤ k ≤ 200; numbers in the matrix are less 1001.

Output specification: Show the first line of reflected matrix.

Sample Input Sample Output
5 3
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
2
H V
15 14 13

Explanation: Given array has been first horizontally reflected, then vertically reflected.



Для отправки решений необходимо выполнить вход.

www.contester.ru