結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
|
提出日時 | 2025-09-06 13:45:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,186 bytes |
コンパイル時間 | 2,383 ms |
コンパイル使用メモリ | 204,764 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-06 13:45:50 |
合計ジャッジ時間 | 3,184 ms |
ジャッジサーバーID (参考情報) |
judge / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#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); HaiB gi(H,vector<bool>(W,true)); 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' && gi[i][j]){ bool ok=true; rep(k,6){ if(S[i][j+k]!=mi[k]){ ok=false; } } if(ok){ S[i][j+4]='Y'; rep(k,6){ gi[i][j+k]=false; } } } if(S[i][j]=='9' && gi[i][j]){ bool ok=true; rep(k,6){ if(S[i][j+k]!=hi[k]){ ok=false; } } if(ok){ S[i][j+1]='Y'; rep(k,6){ gi[i][j+k]=false; } } } } } rep(i,H){ rep(j,W){ cout<<S[i][j]; } cout<<"\n"; } }