結果

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

ソースコード

diff #

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

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  rep(i, h) cin >> s[i];
  rep(i, h) {
    rep(j, w) {
      if (s[i].substr(j, 6) == "yiwiy9") {
        s[i].replace(j, 6, "yiwiY9");
        j += 5;
      }
      else if (s[i].substr(j, 6) == "9yiwiy") {
        s[i].replace(j, 6, "9Yiwiy");
        j += 5;
      }
    }
    cout << s[i] << '\n';
  }
  return 0;
}
0