Submission #159030


Source Code Expand

Copy
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// 入力の読み込み
		Scanner sc = new Scanner(System.in);
		int[][] grid = new int [4][4]; 
		for (int row = 0; row < 4; row++) {
			for (int col = 0; col < 4; col++) {
				grid[row][col] = sc.nextInt();
			}
		}
		sc.close();
		
		// 右か下に同じ数があれば、続行可能。
		String result = "GAMEOVER";
		for (int row = 0; row < 4; row++) {
			for (int col = 0; col < 4; col++) {
				// 右側(あれば)をチェック
				if (col < 3 && grid[row][col] == grid[row][col+1])  {
					result = "CONTINUE"; 
					break; 
				}
				// 左側(あれば)をチェック
				if (row < 3 && grid[row][col] == grid[row+1][col]) {
					result = "CONTINUE"; 
					break; 
				}
			}
		}
		
		// 出力
		System.out.println(result);

	}


}

Submission Info

Submission Time
Task A - DEAD END
User seotch
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 880 Byte
Status
Exec Time 466 ms
Memory 23220 KB

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 hand_1.txt, hand_2.txt, random_1.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_2.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt, random_3.txt, random_30.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt
Case Name Status Exec Time Memory
hand_1.txt 466 ms 23088 KB
hand_2.txt 419 ms 23092 KB
random_1.txt 422 ms 22960 KB
random_10.txt 420 ms 23188 KB
random_11.txt 422 ms 23088 KB
random_12.txt 421 ms 23088 KB
random_13.txt 424 ms 22960 KB
random_14.txt 422 ms 23084 KB
random_15.txt 422 ms 23056 KB
random_16.txt 430 ms 23088 KB
random_17.txt 431 ms 23092 KB
random_18.txt 424 ms 23088 KB
random_19.txt 431 ms 23092 KB
random_2.txt 427 ms 23084 KB
random_20.txt 427 ms 23212 KB
random_21.txt 427 ms 23092 KB
random_22.txt 428 ms 23088 KB
random_23.txt 432 ms 23092 KB
random_24.txt 421 ms 22964 KB
random_25.txt 442 ms 23220 KB
random_26.txt 425 ms 23092 KB
random_27.txt 425 ms 23084 KB
random_28.txt 424 ms 23092 KB
random_29.txt 436 ms 23088 KB
random_3.txt 436 ms 23092 KB
random_30.txt 429 ms 23092 KB
random_4.txt 432 ms 23088 KB
random_5.txt 425 ms 23088 KB
random_6.txt 423 ms 23088 KB
random_7.txt 428 ms 23088 KB
random_8.txt 423 ms 23088 KB
random_9.txt 424 ms 22960 KB
sample_1.txt 425 ms 23088 KB
sample_2.txt 429 ms 23072 KB
sample_3.txt 427 ms 23088 KB