結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー sgfc
提出日時 2025-09-07 21:23:29
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 465 bytes
コンパイル時間 3,518 ms
コンパイル使用メモリ 277,080 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-07 21:23:34
合計ジャッジ時間 4,520 ms
ジャッジサーバーID
(参考情報)
judge / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	ll h, w;
	cin >> h >> w;
	
	vector<string> s(h);
	for(auto&& x : s) cin >> x;
	
	for (int i=0; i<h; ++i) {
		for (int j=0; j<w; ++j) {
			if (s[i][j] != '9') continue;
			
			if (j > 0 && s[i][j-1] == 'y') s[i][j-1] = 'Y'; 
			if (j < w-1 && s[i][j+1] == 'y') s[i][j+1] = 'Y'; 
			
		}
	}

	for(auto&& x : s) cout << x << '\n';
	
}
0