Submission #1352304
Source Code Expand
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); String str = input.readLine(); String[] hw = str.split(" "); int h = Integer.parseInt(hw[0]); int w = Integer.parseInt(hw[0]); int count = 0; for(int i=0; i<h; i++){ str = input.readLine(); count += str.length()-str.replace("#", "").length(); } if(h+w-1==count){ System.out.println("Possible"); }else{ System.out.println("Impossible"); } } }
Submission Info
Submission Time | |
---|---|
Task | A - Shik and Stone |
User | unirita51 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 666 Byte |
Status | WA |
Exec Time | 79 ms |
Memory | 23380 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 79 ms | 17620 KB |
001.txt | AC | 70 ms | 20052 KB |
002.txt | AC | 76 ms | 20180 KB |
003.txt | AC | 70 ms | 15956 KB |
004.txt | AC | 71 ms | 19284 KB |
005.txt | AC | 72 ms | 23380 KB |
006.txt | AC | 69 ms | 19284 KB |
007.txt | AC | 69 ms | 21332 KB |
008.txt | AC | 69 ms | 20180 KB |
009.txt | WA | 70 ms | 19412 KB |
010.txt | WA | 73 ms | 19156 KB |
011.txt | AC | 70 ms | 21204 KB |
012.txt | AC | 71 ms | 19156 KB |
013.txt | WA | 69 ms | 19284 KB |
014.txt | WA | 71 ms | 20692 KB |
015.txt | WA | 71 ms | 19156 KB |
016.txt | WA | 69 ms | 23124 KB |
017.txt | AC | 71 ms | 20308 KB |
018.txt | WA | 70 ms | 18388 KB |
example0.txt | WA | 70 ms | 21204 KB |
example1.txt | AC | 71 ms | 15700 KB |
example2.txt | AC | 70 ms | 19028 KB |