結果
問題 | No.179 塗り分け |
ユーザー |
![]() |
提出日時 | 2017-03-11 13:57:52 |
言語 | C++11 (gcc 11.4.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,665 bytes |
コンパイル時間 | 726 ms |
コンパイル使用メモリ | 82,584 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-03 03:33:27 |
合計ジャッジ時間 | 6,368 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,820 KB |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | RE | - |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | WA | - |
testcase_08 | AC | 3 ms
6,816 KB |
testcase_09 | AC | 4 ms
6,816 KB |
testcase_10 | AC | 2 ms
6,816 KB |
testcase_11 | AC | 3 ms
6,820 KB |
testcase_12 | RE | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | AC | 2 ms
6,816 KB |
testcase_17 | WA | - |
testcase_18 | AC | 3 ms
6,816 KB |
testcase_19 | AC | 3 ms
6,820 KB |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | AC | 3 ms
6,820 KB |
testcase_24 | RE | - |
testcase_25 | AC | 3 ms
6,816 KB |
testcase_26 | AC | 3 ms
6,816 KB |
testcase_27 | RE | - |
testcase_28 | AC | 3 ms
6,816 KB |
testcase_29 | RE | - |
testcase_30 | AC | 3 ms
6,816 KB |
testcase_31 | RE | - |
testcase_32 | AC | 3 ms
6,816 KB |
testcase_33 | RE | - |
testcase_34 | AC | 3 ms
6,820 KB |
testcase_35 | RE | - |
testcase_36 | RE | - |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | RE | - |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
ソースコード
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define ll long long #define PI acos(-1.0) #define FOR(I,A,B) for(int I = (A); I < (B); ++I) //方針 //全てのマスについて(dx, dy)移動した先に黒マスがあればOK //全探索 int main(){ int H, W; cin >> H >> W; vector<string> mass(H); FOR(i, 0, H) cin >> mass[i]; bool isPainted[H][W]; bool check; FOR(dy, -50, 51){ FOR(dx, -50, 51){ if(dy==0 && dx==0) continue; FOR(i, 0, H) FOR(j, 0, W) isPainted[i][j] = false; check = true; //注目するマスをFORでまわす FOR(z, 0, (H-1)*H+W){ int y = z / H; int x = z % H; if(mass[y][x]=='#' && isPainted[y][x]==false){ isPainted[y][x]=true; if(y+dy<0 || y+dy>H || x+dx<0 || x+dx>W){ check = false; break; } if(mass[y+dy][x+dx]=='#' && isPainted[y+dy][x+dx]==false){ isPainted[y+dy][x+dx]=true; } else{ check = false; break; } } } if(check){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; }