結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
|
提出日時 | 2025-09-06 13:53:56 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 771 bytes |
コンパイル時間 | 3,517 ms |
コンパイル使用メモリ | 273,228 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-09-06 13:54:20 |
合計ジャッジ時間 | 4,488 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 17 |
ソースコード
#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; if (S[0] == '9' && S[1] == 'y') S[1] = 'Y'; for (int i = 0; i < ssize(S) - 1; i++) { if (S[i] == 'y' && S[i + 1] == '9') { S[i] = 'Y'; } } for (int i = 0; i < ssize(S) - 2; i++) { if (S[i] != 'Y' && S[i + 1] == '9' && S[i + 2] == 'y') { S[i + 2] = 'Y'; } } cout << S << endl; } }