結果
問題 |
No.179 塗り分け
|
ユーザー |
![]() |
提出日時 | 2015-04-06 00:49:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,614 bytes |
コンパイル時間 | 797 ms |
コンパイル使用メモリ | 86,728 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-10-02 13:35:37 |
合計ジャッジ時間 | 1,869 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 34 WA * 6 |
ソースコード
#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=0;l<W;l++){ if(M[k][l] == '#' and used[k][l] == 0){ if(k+i< H 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; }