結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
|
提出日時 | 2025-08-07 10:42:52 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 955 bytes |
コンパイル時間 | 3,662 ms |
コンパイル使用メモリ | 278,296 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-07 10:42:58 |
合計ジャッジ時間 | 4,621 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 19 |
ソースコード
#include <bits/stdc++.h> static inline constexpr const std::vector<std::string>& solve(const uint_fast32_t H, const uint_fast32_t W, std::vector<std::string>& S) noexcept { for (uint_fast32_t i = 0; i != H; ++i) { auto pos_l = S[i].find("9yiwiy"); auto pos_r = S[i].find("yiwiy9"); while (std::min(pos_l, pos_r) != S[i].npos) { if (pos_l < pos_r) S[i][pos_l + 1] = 'Y', pos_l = S[i].find("9yiwiy"); else S[i][pos_r + 4] = 'Y', pos_r = S[i].find("yiwiy9"); } } return S; } static inline void output(const uint_fast32_t H, const uint_fast32_t W, const std::vector<std::string>& ans) noexcept { for (uint_fast32_t i = 0; i != H; ++i) std::cout << ans[i] << '\n'; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); uint_fast32_t H, W, i; std::cin >> H >> W; std::vector<std::string> S(H); for (i = 0; i != H; ++i) S[i].reserve(W), std::cin >> S[i]; output(H, W, solve(H, W, S)); return 0; }