結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー ロロット
提出日時 2025-09-06 13:41:34
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 3,774 ms
コンパイル使用メモリ 272,944 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-09-06 13:41:41
合計ジャッジ時間 4,328 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(a) (a).begin(), (a).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int H, W;
    cin >> H >> W;
    for (; H--;) {
        string S;
        cin >> S;
        for (int i = 0; i < ssize(S) - 1; i++) {
            if (S[i] == 'y' && S[i + 1] == '9') {
                S[i] = 'Y';
            }
            if (S[i] == '9' && S[i + 1] == 'y') {
                S[i + 1] = 'Y';
            }
        }
        cout << S << endl;
    }
}
0