Logo
(追記) (追記ここまで)

35014번 - Hex Operations 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB222100.000%

문제

In this problem, a hex is a six-sided board consisting of cells: small regular hexagons. A hex of size $n$ has $n$ cells on each side. Each cell contains an integer.

Consider the following operations with a hex:

  • "T": reflect the hex over its vertical symmetry axis,
  • "R": rotate the hex 60 degrees clockwise,
  • "L": rotate the hex 60 degrees counter-clockwise.

Here is an example of a hex of size $n = 3$ and operations with it:

You are given a hex and a sequence of operations. Perform all the given operations in order and print the resulting hex.

입력

The first line contains an integer $n,ドル the size of the hex (2ドル \le n \le 500$). The next 2ドル n - 1$ lines contain integers from 1ドル$ to 99ドル$ initially contained in the cells of the hex. Each line contains space-separated integers: exactly as many as the number of cells in the corresponding row of the hex. Additionally, for ease of reading, these lines may contain additional spaces before all numbers, between consecutive numbers, and after all numbers.

The last line is the sequence of operations. It has a length from 1ドル$ to 250ドル,000円$ characters and consists of letters "T", "R" and "L".

The total size of the input, including spaces and line breaks, does not exceed 2ドル^{23}$ bytes.

출력

Print the hex after performing all operations: 2ドル n - 1$ lines containing integers. Each line should contain several space-separated integers: exactly as many as the number of cells in the corresponding row of the hex. Additionally, for ease of reading, these lines may contain additional spaces before all numbers, between consecutive numbers, and after all numbers.

The total size of the output, including spaces and line breaks, should not exceed 2ドル^{23}$ bytes.

제한

예제 입력 1

3
 4 1 8 
 3 5 1 7 
2 1 6 1 8
 1 7 1 9 
 8 9 9 
LTR

예제 출력 1

 9 9 8
 9 1 1 7
8 7 6 1 8
 1 1 5 1
 2 3 4

노트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2025-2026 Northwestern Russia Qualification K번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /