report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Matrix rotation - FlandreOJ: Flandre Online Judge

Matrix rotation

Time limit: 1000 ms
Memory limit: 256 MB
Given a matrix of size $n \times n$ consisting of integers. Rotate it 90 degrees clockwise in place. ### Input - The first line contains an integer n. - The next $n$ lines, each line contains $n$ integers representing the matrix. ### Output - Print the given matrix after rotating. ### Constraints - $1 \le n \le 50$. - $1 \le A_i \le 100$ ### Example Input: ``` 3 1 2 3 4 5 6 7 8 9 ``` Output: ``` 7 4 1 8 5 2 9 6 3 ```
Two dimensional array
Pascal's triangle
Column sum
Appearance
Diagonal sum
Point coverage
Swap operation
Spiral matrix
Word search
Matrix rotation
Matrix Zigzag
Topic
Basic
Rating 800
Solution (1) Solution