結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
|
提出日時 | 2025-09-06 13:37:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,026 bytes |
コンパイル時間 | 2,053 ms |
コンパイル使用メモリ | 198,220 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-09-06 13:37:55 |
合計ジャッジ時間 | 3,337 ms |
ジャッジサーバーID (参考情報) |
judge / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (ll)(n); i++) #define oke cout << "Yes" << '\n'; #define dame cout << "No" << '\n'; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() using HaiI = vector<vector<int>>; using Hai2 = vector<vector<ll>>; using HaiB = vector<vector<bool>>; using Hai3 = vector<vector<vector<ll>>>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); int H,W; cin>>H>>W; vector<string>S(H); string mi="yiwiy9"; string hi="9yiwiy"; rep(i,H){ cin>>S[i]; } rep(i,H){ for(int j=0;j<W-5;j++){ if(S[i][j]=='y'){ bool ok=true; rep(k,6){ if(S[i][j+k]!=mi[k]){ ok=false; } } if(ok){ S[i][j+4]='Y'; } } if(S[i][j]=='9'){ bool ok=true; rep(k,6){ if(S[i][j+k]!=hi[k]){ ok=false; } } if(ok){ S[i][j+1]='Y'; } } } } rep(i,H){ rep(j,W){ cout<<S[i][j]; } cout<<"\n"; } }