結果

問題 No.179 塗り分け
ユーザー e-mone-mon
提出日時 2015-04-06 01:21:32
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,643 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 87,488 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 11:42:34
合計ジャッジ時間 2,126 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 13 ms
6,940 KB
testcase_09 WA -
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 14 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 8 ms
6,944 KB
testcase_21 AC 7 ms
6,940 KB
testcase_22 AC 11 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 10 ms
6,944 KB
testcase_25 AC 2 ms
6,940 KB
testcase_26 WA -
testcase_27 AC 4 ms
6,940 KB
testcase_28 WA -
testcase_29 AC 3 ms
6,940 KB
testcase_30 WA -
testcase_31 AC 3 ms
6,944 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 3 ms
6,940 KB
testcase_34 WA -
testcase_35 AC 3 ms
6,940 KB
testcase_36 AC 1 ms
6,940 KB
testcase_37 AC 2 ms
6,940 KB
testcase_38 AC 2 ms
6,940 KB
testcase_39 AC 1 ms
6,940 KB
testcase_40 AC 2 ms
6,944 KB
testcase_41 AC 2 ms
6,940 KB
testcase_42 AC 2 ms
6,944 KB
testcase_43 AC 2 ms
6,944 KB
testcase_44 AC 2 ms
6,940 KB
testcase_45 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

int main(){
    int H,W;
    cin >> H >> W;
    char M[H][W];
    int used[H][W];
    FOR(i,0,H){
        FOR(j,0,W){
            cin >> M[i][j];
         }
    }

    REP(i,H){
        REP(j,W){
            if(i == 0 and j == 0) continue;
            int count = 0;
            memset(used,0,H*W*sizeof(int));
            REP(k,H){
                int l;
                for(l=-W;l<W;l++){
                    if(M[k][l] == '#' and used[k][l] == 0){
                        if(0 <= k + i and k+i< H and 0 <= l+j and l+j < W and  M[k+i][l+j] == '#' and used[k+i][l+j] == 0){
                            used[k][l] = 1;
                            used[k+i][l+j] = 1;
                        }else{
                            break;
                        }
                    }
                }
                if(l==W) count++;
            }
            if(count == H){
                cout << "YES" << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;

    return 0;
}
0