結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー kotatsugame
提出日時 2025-09-06 13:39:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 317 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 62,520 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-06 13:40:01
合計ジャッジ時間 1,705 ms
ジャッジサーバーID
(参考情報)
judge2 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cassert>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N,M;cin>>N>>M;
	for(;N--;)
	{
		string S;cin>>S;
		for(int i=0;i<M;i++)if(S[i]=='9')
		{
			if(i>0&&S[i-1]=='y')S[i-1]='Y';
			else if(i+1<M&&S[i+1]=='y')S[i+1]='Y';
		}
		cout<<S<<"\n";
	}
}
0