結果
| 問題 | No.3703 回転 (Rotation) |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-09-22 10:42:34 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 13 ms / 2,000 ms |
| + 450µs | |
| コード長 | 1,062 bytes |
| 記録 | |
| コンパイル時間 | 669 ms |
| コンパイル使用メモリ | 199,056 KB |
| 実行使用メモリ | 9,912 KB |
| 最終ジャッジ日時 | 2026-09-22 10:42:38 |
| 合計ジャッジ時間 | 3,663 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
warning: unused variable: `W` --> src/main.rs:38:9 | 38 | W: usize, | ^ help: if this is intentional, prefix it with an underscore: `_W` | = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
ソースコード
#![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<T: Copy + Default>(g: &[Vec<T>]) -> Vec<Vec<T>> {
// 時計回り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::<Vec<char>>::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(""));
}
}
norioc