結果

問題 No.455 冬の大三角
ユーザー aaaaaaiu
提出日時 2019-08-17 13:52:46
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 715 bytes
コンパイル時間 2,696 ms
コンパイル使用メモリ 195,764 KB
最終ジャッジ日時 2025-01-07 13:23:40
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 52 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int h,w;
    cin>>h>>w;
    string s[h];
    for (int i=0;i<h;i++) cin>>s[i];
    for (int i=0;i<h;i++)
        for (int j=0;j<w;j++)
            if (s[i][j]=='-') {
                int cnt=0;
                for (int k=0;k<h;k++)
                    if (s[k][j]=='*')
                        cnt++;
                if (cnt==2) continue;
                cnt=0;
                for (int k=0;k<w;k++)
                    if (s[i][k]=='*')
                        cnt++;
                if (cnt==2) break;
                s[i][j]='*';
                goto a;
            }
    a:;
    for (string b:s) cout<<b<<endl;
    return 0;
}
0