結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー The_Bouningeeeen
提出日時 2025-09-08 22:51:05
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 963 bytes
コンパイル時間 14,533 ms
コンパイル使用メモリ 397,576 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-08 22:51:21
合計ジャッジ時間 12,710 ms
ジャッジサーバーID
(参考情報)
judge / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

    let yiwiy_n = vec!['y', 'i', 'w', 'i', 'y', '9'];
    let yiwi_y_n = vec!['y', 'i', 'w', 'i', 'Y', '9'];
    let n_yiwiy = vec!['9', 'y', 'i', 'w', 'i', 'y'];
    let n_y_iwiy = vec!['9', 'Y', 'i', 'w', 'i', 'y'];
    for i in 0..h {
        let mut ans = vec![];
        let mut queue = vec![];

        for _ in 0..w {
            queue.push(s[i].remove(0));

            if queue.len() > 6 {
                ans.push(queue.remove(0));
                continue;
            }

            if queue == yiwiy_n {
                queue.clear();
                ans.extend(yiwi_y_n.clone());
            } else if queue == n_yiwiy {
                queue.clear();
                ans.extend(n_y_iwiy.clone());
            }
        }

        ans.extend(queue);

        println!("{}", ans.iter().collect::<String>());
    }
}
0