結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
![]() |
提出日時 | 2025-09-06 13:10:06 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 837 bytes |
コンパイル時間 | 3,432 ms |
コンパイル使用メモリ | 273,092 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-09-06 13:12:02 |
合計ジャッジ時間 | 4,393 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 WA * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define ll long long const long long mod=998244353; const long long hmod=46216567629137; int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); int H,W; cin>>H>>W; char S[H+1][W+1]; for(int i=1;i<=H;i++){ for(int j=1;j<=W;j++){ cin>>S[i][j]; } } for(int i=1;i<=H;i++){ for(int j=1;j<=W;j++){ if(S[i][j]=='9'){ if(j==1) S[i][j+1]='Y'; else if(j==W) S[i][j-1]='Y'; else{ if(S[i][j+1]=='y') S[i][j+1]='Y'; else S[i][j-1]='Y'; } } } } for(int i=1;i<=H;i++){ for(int j=1;j<=W;j++) cout<<S[i][j]; cout<<"\n"; } }