結果

問題 No.455 冬の大三角
コンテスト
ユーザー aaaaaaiu
提出日時 2019-08-17 13:52:46
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 715 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,364 ms
コンパイル使用メモリ 215,932 KB
実行使用メモリ 9,908 KB
最終ジャッジ日時 2026-10-23 23:54:49
合計ジャッジ時間 4,471 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 52 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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