結果

問題 No.179 塗り分け
ユーザー hogeover30hogeover30
提出日時 2018-07-10 17:13:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 2,085 ms
コンパイル使用メモリ 202,524 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 10:00:45
合計ジャッジ時間 5,870 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 17 ms
4,348 KB
testcase_06 AC 5 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 4 ms
4,348 KB
testcase_10 AC 25 ms
4,352 KB
testcase_11 AC 21 ms
4,348 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,348 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 2 ms
4,352 KB
testcase_17 WA -
testcase_18 AC 26 ms
4,348 KB
testcase_19 AC 23 ms
4,352 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 41 ms
4,348 KB
testcase_24 WA -
testcase_25 AC 62 ms
4,352 KB
testcase_26 AC 69 ms
4,348 KB
testcase_27 AC 188 ms
4,352 KB
testcase_28 AC 92 ms
4,356 KB
testcase_29 AC 195 ms
4,352 KB
testcase_30 AC 46 ms
4,348 KB
testcase_31 AC 198 ms
4,352 KB
testcase_32 AC 57 ms
4,348 KB
testcase_33 AC 185 ms
4,348 KB
testcase_34 AC 72 ms
4,348 KB
testcase_35 AC 191 ms
4,352 KB
testcase_36 AC 1 ms
4,348 KB
testcase_37 AC 2 ms
4,352 KB
testcase_38 AC 2 ms
4,352 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 1 ms
4,352 KB
testcase_41 AC 2 ms
4,352 KB
testcase_42 AC 2 ms
4,352 KB
testcase_43 AC 4 ms
4,348 KB
testcase_44 AC 23 ms
4,352 KB
testcase_45 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int H, W; cin>>H>>W;
    vector<string> S(H); for(auto& e: S) cin>>e;

#define REP(i, a, b) for(int i=a; i<b; ++i)
    
    REP(r, -H, H) REP(c, -W, W) if (c|r) {
        auto T=S;
        REP(i, 0, H) REP(j, 0, W) if (0<=i+r && i+r<H && 0<=j+c && j+c<W) 
            if (T[i][j] && S[i][j]==S[i+r][j+c]) T[i][j]=T[i+r][j+c]=0;

        int no=0;
        REP(i, 0, H) REP(j, 0, W)
            no|=T[i][j] && S[i][j]=='#';
        if (!no) return !printf("YES\n");
    }
    puts("NO");
}
0