結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー l33t
提出日時 2025-09-07 06:21:01
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 788 bytes
コンパイル時間 3,941 ms
コンパイル使用メモリ 279,580 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-07 06:21:07
合計ジャッジ時間 4,561 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(obj) (obj).begin(), (obj).end()
using ll = long long;
using namespace std;

int main() {
    int H,W;cin>>H>>W;
    vector<string> S(H);
    string left = "9yiwiy";
    string right = "yiwiy9";
    rep(i,H) cin>>S[i];

    for(int y = 0; y < H; y++){
        for(int x = 0; x < W-5; ){
            bool update = false;
            if(S[y].substr(x,6) == left){
                S[y][x+1]= 'Y';
                update = true;
                x+=6;
            }
            if(S[y].substr(x,6) == right){
                S[y][x+4]= 'Y';
                update = true;
                x+=6;
            }
            if(!update)x++;
        }
    }
    for(auto s:S){
        cout << s << endl;
    }
}
0