AtCoder Grand Contest 007

Submission #1352316

Source codeソースコード


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;
		boolean start=false, end=false;
		for(int i=0; i<h; i++){
			str = input.readLine();
			if(i==0){
				if(str.startsWith("#")){
					start = true;
				}
			}
			if(i==h-1){
				if(str.endsWith("#")){
					end = true;
				}
			}

			count += str.length()-str.replace("#", "").length();
		}

		if(h+w-1==count && start && end){
			System.out.println("Possible");
		}else{
			System.out.println("Impossible");
		}


	}

}

Submission

Task問題 A - Shik and Stone
User nameユーザ名 森崇仁
Created time投稿日時
Language言語 Java8 (OpenJDK 1.8.0)
Status状態 WA
Score得点 0
Source lengthソースコード長 871 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - example0.txt,example1.txt,example2.txt
All 0 / 200 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
000.txt AC 74 ms 22612 KB
001.txt AC 73 ms 19284 KB
002.txt AC 71 ms 25044 KB
003.txt AC 73 ms 18900 KB
004.txt AC 70 ms 21204 KB
005.txt AC 72 ms 19284 KB
006.txt AC 71 ms 19284 KB
007.txt AC 72 ms 21076 KB
008.txt AC 71 ms 23124 KB
009.txt WA
010.txt WA
011.txt AC 71 ms 19284 KB
012.txt AC 72 ms 19284 KB
013.txt WA
014.txt WA
015.txt WA
016.txt WA
017.txt AC 74 ms 20948 KB
018.txt WA
example0.txt WA
example1.txt AC 75 ms 23252 KB
example2.txt AC 73 ms 23252 KB