HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Linear Data Structures: Arrays > problem:


51084 - Reflect a matrix

Guest
• Review clarifications (2)

Section problems

• 50874 - Apartment Building Adminis...
• 51127 - Maze solver
• 51126 - Dr. Fllanxha
• 51021 - Number of Nodes
• 51044 - Number of Trees
• 51098 - Rotate a matrix
• 51061 - The Longest Path
• 51083 - Grades Histogram
• 51084 - Reflect a matrix
• 51011 - Decoding the Path
• 51088 - Number of letters
• 51172 - The biggest Minute
• 51125 - Filling an Array 3
• 51085 - xyx Divisible by k
• 51087 - Are they the same?
• 51091 - Guess the number - 1
• 51015 - Student Scholarships

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