問題一覧 > 通常問題

No.3703 Rotation

レベル : / AI推定難易度 : 140 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 34
作問者 : Rapca1256 / テスター : tomorunn
お気に入りにしたユーザー ProblemId : 13983 / 自分の提出
問題文最終更新日: 2026-09-10 17:28:12
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
JOI1次風非公式模試 (Suken Programming Contest 007) (順位表) の他の問題:

Problem Statement

Suuken-kun is playing "Suuken Quest", a game about exploring a map. Because of a display glitch, the screen has been rotated by 90 degrees, and he wants to restore it.
You are given a grid $G$ represented by $H$ strings $S_1,S_2,\cdots, S_H$ of length $W$ consisting only of . and #.
When the $j$-th character of $S_i$ is the character $c$, $c$ is written in the cell of $G$ that is $i$-th from the top and $j$-th from the left.
Output the $W$ strings $S'_1, S'_2, \cdots ,S'_W$ representing the new grid $G'$ obtained by rotating $G$ 90 degrees clockwise, according to the following format.

  • When $c$ is written in the cell of $G'$ that is $i$-th from the top and $j$-th from the left, the $j$-th character of $S'_i$ is $c$.

Input

$H\ W$
$S_1$
$S_2$
$\cdots$
$S_H$
  • $1 \le H, W \le 1000$.
  • $H,W$ are integers.
  • $S_i$ consists only of . or #.

Output

Output $W$ lines. On the $i$-th line, output $S'_i$.
Do not output anything other than the answer. (Do not output text such as prompts for input.)
For the answer format, you may refer to the practice problems and their sample solutions, but note that no links are provided.

Sample

Sample 1
Input
5 6
..#...
.#....
######
.#....
..#...
Output
..#..
.###.
#.#.#
..#..
..#..
..#..
Sample 2
Input
1 1
#
Output
#

Sample 3
Input
34 5
#####
....#
...#.
.##..
#....
#####
.....
#.#.#
#.#.#
#.#.#
#.#.#
#.#.#
#####
.....
#...#
.#.#.
.#.#.
..#..
..#..
#####
.....
####.
....#
....#
....#
....#
####.
.....
...#.
#.#.#
#.#.#
#.#.#
#.#.#
.#...
Output
.####..#....#.#....#.######.##...#
#......#....#.#..##..#......#.#..#
.####..#....#.###....######.#.#..#
.....#.#....#.#..##..#......#..#.#
.####...####..#....#.######.#...##

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。