Please sign in first.
Submission #2463679
Source Code Expand
($h, $w)=split / /, <>;
while(<>){
chomp;
@{$mat[@mat]}=split //, $_;
}
$flag=0;
for($i=0; $i<$h; $i++){
for($j=0; $j<$w; $j++){
if($mat[$i][$j] eq '#'){
if($mat[$i-1][$j] ne '#' && $mat[$i+1][$j] ne '#' && $mat[$i][$j-1] ne '#' && $mat[$i][$j+1] ne '#'){$flag=1; last;}
}
}
last if $flag;
}
if($flag){print "No\n";}
else{print "Yes\n";}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Grid Repainting 2 |
| User | nipo |
| Language | Perl (v5.18.2) |
| Score | 300 |
| Code Size | 364 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 768 KiB |
Compile Error
./Main.pl syntax OK
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 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 | AC | 4 ms | 768 KiB |
| in02.txt | AC | 3 ms | 640 KiB |
| in03.txt | AC | 3 ms | 640 KiB |
| in04.txt | AC | 3 ms | 640 KiB |
| in05.txt | AC | 3 ms | 640 KiB |
| in06.txt | AC | 3 ms | 640 KiB |
| in07.txt | AC | 3 ms | 640 KiB |
| in08.txt | AC | 3 ms | 640 KiB |
| in09.txt | AC | 3 ms | 640 KiB |
| in10.txt | AC | 3 ms | 640 KiB |
| sample_01.txt | AC | 2 ms | 384 KiB |
| sample_02.txt | AC | 2 ms | 512 KiB |
| sample_03.txt | AC | 2 ms | 512 KiB |