結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
|
提出日時 | 2025-09-06 13:17:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 1,066 bytes |
コンパイル時間 | 2,175 ms |
コンパイル使用メモリ | 198,404 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-09-06 13:18:29 |
合計ジャッジ時間 | 3,190 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/lazysegtree> using namespace std; using ll = long long; const int INF = 1001001001; const ll LINF = 3001001001001001001; const int MOD = 998244353; const string Yes = "Yes"; const string No = "No"; #define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i) #define rep(i, n) reps(i, 0, n) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} template <typename T> istream &operator>>(istream &is, vector<T> &v) {for (T &in : v)is >> in;return is;} vector<pair<int,int>> dir = {{0,1},{1,0},{0,-1},{-1,0},}; int main() { int h,w;cin>>h>>w; vector<string> s(h);cin>>s; rep(i,h) rep(j,w) { if(s.at(i).at(j)=='9') { if(j>=5 && s.at(i).substr(j-5,5)=="yiwiy") { s.at(i).at(j-1) = 'Y'; } else { s.at(i).at(j+1) = 'Y'; } } } rep(i,h) cout << s.at(i) << endl; return 0; }