ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Linear Data Structures: Arrays > задача:


51098 - Rotate a matrix

Гость
• Вопросы к жюри (1)

Задачи раздела

• 50823 - Secret Number
• 50853 - Parking Place
• 50990 - Two Neighbors
• 50496 - Falling Bricks
• 51021 - Number of Nodes
• 50829 - Decode an Image
• 51044 - Number of Trees
• 50876 - He is my cousin
• 51098 - Rotate a matrix
• 50838 - Balanced Numbers
• 50851 - Repeated Numbers
• 51061 - The Longest Path
• 51083 - Grades Histogram
• 51084 - Reflect a matrix
• 51011 - Decoding the Path
• 50515 - Lines - Revisited
• 51088 - Number of letters

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Rotate a matrix

Question: For a course, you are required to write a program to rotate a 2D array according to the given degree. Write program that gets a 2D array and a rotation degree, then the program rotates and prints the 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 r lines. On the last line, you will be given an integer, which is a multiple of 90 and less than 100,000; where 1 ≤ (r and c) ≤ 100 and the numbers in the matrix are less 1001.

Output specification: Show rotated matrix.

Sample Input I Sample Input II
5 3
7 9 17
9 14 12
6 11 7
13 15 5
5 7 7
90
5 3
19 8 6
7 13 16
8 4 11
5 20 20
20 5 14
180
Sample Output I Sample Output II
5 13 6 9 7
7 15 11 14 9
7 5 7 12 17
14 5 20
20 20 5
11 4 8
16 13 7
6 8 19



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

www.contester.ru