結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー yiwiy9
提出日時 2025-09-06 13:40:04
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 24,441 ms
コンパイル使用メモリ 378,208 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-06 13:40:46
合計ジャッジ時間 16,590 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::{input, marker::Chars};

fn main() {
    input! {
        h: usize,
        w: usize,
        mut s: [Chars; h],
    }

    for i in 0..h {
        for j in 0..w {
            if s[i][j] == 'y' {
                if j > 0 && s[i][j - 1] == '9' {
                    s[i][j] = 'Y'
                }
                if j < w - 1 && s[i][j + 1] == '9' {
                    s[i][j] = 'Y'
                }
            }
        }
    }

    println!(
        "{}",
        s.iter()
            .map(|x| x.iter().collect::<String>())
            .collect::<Vec<_>>()
            .join("\n")
    );
}
0