結果

問題 No.179 塗り分け
ユーザー sugarrrsugarrr
提出日時 2018-03-03 15:09:08
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,137 bytes
コンパイル時間 635 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 17:42:54
合計ジャッジ時間 2,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>

using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
#define inf 100000000/*10^8*/
#define rep(i,l,r) for(int i=l;i<=r;i++)
const double EPS=1E-8;

////////////////////////////////////////
int h,w;
char p[50][50+1];
bool flag=false;
void solve(int x,int y){
    char m[h][51];
    rep(i,0,h-1)rep(j,0,w-1)m[i][j]=p[i][j];
    rep(i,0,h-1)rep(j,0,w-1){
        if(m[i][j]=='#'){
            m[i][j]='.';
            if(i+x>=h||j+y>=w)return;
            if(m[i+x][j+y]=='.')return;
            m[i+x][j+y]='.';
        }
    }
    cout<<"YES";  
    flag=true;
}



int main(){
    cin>>h>>w;
    rep(i,0,h-1)cin>>p[i];
    rep(i,0,h-1){
        rep(j,0,w-1){
            solve(i,j);
        }
    }
    if(!flag)cout<<"NO";
    
    return 0;
}
0