結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
![]() |
提出日時 | 2025-09-06 13:15:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 900 bytes |
コンパイル時間 | 1,003 ms |
コンパイル使用メモリ | 110,292 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-06 13:17:17 |
合計ジャッジ時間 | 2,029 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 19 |
ソースコード
#include <iostream> #include <iomanip>//小数点出力用 //cout << fixed << setprecision(10) << ans; #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <unordered_map> using ll = long long; using namespace std; #define modPHash (ll)((1LL<<61)-1) #define modP (ll)998244353 bool chkrng0idx(int pos, int sup) { return (0 <= pos && pos < sup); } int clk4(int num) { return (num - 2) * (num % 2); } void yn(bool tf) { cout << (tf ? "Yes\n" : "No\n"); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll H, W; cin >> H >> W; while (H--) { string S; cin >> S; for (int i = 0;i < S.size();i++) { if (S[i] == '9') { if (i > 0 && S[i - 1] == 'y') { S[i - 1] = 'Y'; } if (i < S.size() - 1 && S[i + 1] == 'y') { S[i + 1] = 'Y'; } } } cout << S << endl; } return 0; }