結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー The_Bouningeeeen
提出日時 2025-09-08 23:03:42
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 723 bytes
コンパイル時間 13,588 ms
コンパイル使用メモリ 391,260 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-09-08 23:03:57
合計ジャッジ時間 15,449 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

    if w < 6 {
        for s in s {
            println!("{}", s.iter().collect::<String>());
        }
        return;
    }

    for i in 0..h {
        let mut j = 0;
        while j + 5 < w {
            if &s[i][j..j + 6] == &['y', 'i', 'w', 'i', 'y', '9'] {
                s[i][j + 4] = 'Y';
                j += 6
            } else if &s[i][j..j + 6] == &['9', 'y', 'i', 'w', 'i', 'y'] {
                s[i][j + 1] = 'Y';
                j += 6
            } else {
                j += 1;
            }
        }
        println!("{}", s[i].iter().collect::<String>());
    }
}
0