#![allow(non_snake_case, unused_imports)] use std::collections::{BinaryHeap, HashMap, HashSet}; use proconio::{input, marker::Usize1, marker::Chars}; use itertools::Itertools; #[allow(unused_macros)] macro_rules! d { ( $( $x:expr ),* $(,)? ) => { eprintln!( concat!( $( stringify!($x), "={:?} " ),* ), $( $x ),* ); }; } #[allow(dead_code)] fn yn(b: bool) -> &'static str { if b { "Yes" } else { "No" } } fn grid_rot(g: &[Vec]) -> Vec> { // 時計回り90回転 let h = g.len(); let w = g[0].len(); let mut res = vec![vec![T::default(); h]; w]; for i in 0..h { for j in 0..w { res[j][h-i-1] = g[i][j].clone(); } } res } fn main() { input! { H: usize, W: usize, } let mut g = Vec::>::new(); for _ in 0..H { input! { S: String } g.push(S.chars().collect()); } let res = grid_rot(&g); for s in res { println!("{}", s.iter().join("")); } }