結果

問題 No.3261 yiwiy9 → yiwiY9
コンテスト
ユーザー ふやけももんが
提出日時 2025-11-14 15:20:07
言語 C++17
(gcc 13.3.0 + boost 1.89.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 573 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,737 ms
コンパイル使用メモリ 194,864 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-11-14 15:20:10
合計ジャッジ時間 3,097 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;

int main(){
    int H,W;
    cin >> H >> W;
    for(int i = 0;i<H;i++){
        string str;
        cin >> str;
        int qcount = 0;
        for(int j = 0;j<W;j++){
            if(str[j] == '9'){
                qcount++;
            }
            else if(str[j] == 'w'){
                if(qcount >0){
                    str[j-2] = 'Y';
                }
                else{
                    str[j+2] = 'Y';
                }
                qcount--;
            }
        }
        cout << str << endl;
    }
    
}
0