Submission #3418514
Source Code Expand
#include <bits/stdc++.h> #define INF 100100100 #define MOD 1000000007 using namespace std; using ll = long long; using ull = unsigned long long ; #define FOR(i,n) for(ll i=0;i<n;i++) struct edge{ll to,cost;}; int x[] = {1,-1,0,0}; int y[] = {0,0,1,-1}; int main(int argc, char const* argv[]){ ios::sync_with_stdio(false); cin.tie(0); int H,W; cin >> H >> W; vector<string>s(H); bool flag; FOR(i,H)cin >> s[i]; FOR(i,H){ FOR(j,W){ flag = true; FOR(k,4){ if(s[j][i] == '.'){ flag = false; continue; } else if(i+x[k]<W && i+x[k]>=0 && j+y[k]<H && j+y[k]>=0){ if(s[j+y[k]][i+x[k]] == '#')flag = false; } } if(flag){ cout << "No" << endl; return 0; } } } cout << "Yes" << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Grid Repainting 2 |
User | reg7777 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 949 Byte |
Status | RE |
Exec Time | 98 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | RE | 97 ms | 256 KB |
in02.txt | WA | 1 ms | 256 KB |
in03.txt | RE | 98 ms | 256 KB |
in04.txt | WA | 1 ms | 256 KB |
in05.txt | AC | 1 ms | 256 KB |
in06.txt | AC | 1 ms | 256 KB |
in07.txt | RE | 98 ms | 256 KB |
in08.txt | WA | 1 ms | 256 KB |
in09.txt | AC | 1 ms | 256 KB |
in10.txt | AC | 1 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |