結果

問題 No.870 無敵囲い
ユーザー 37zigen37zigen
提出日時 2019-08-30 22:48:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 300 ms
コード長 783 bytes
コンパイル時間 2,677 ms
コンパイル使用メモリ 74,364 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2023-09-11 16:15:06
合計ジャッジ時間 6,222 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,684 KB
testcase_01 AC 123 ms
55,864 KB
testcase_02 AC 118 ms
55,680 KB
testcase_03 AC 124 ms
55,924 KB
testcase_04 AC 123 ms
56,012 KB
testcase_05 AC 120 ms
55,716 KB
testcase_06 AC 120 ms
56,060 KB
testcase_07 AC 118 ms
55,680 KB
testcase_08 AC 118 ms
55,836 KB
testcase_09 AC 118 ms
55,892 KB
testcase_10 AC 116 ms
55,512 KB
testcase_11 AC 118 ms
55,844 KB
testcase_12 AC 118 ms
56,196 KB
testcase_13 AC 118 ms
55,824 KB
testcase_14 AC 117 ms
55,684 KB
testcase_15 AC 119 ms
55,456 KB
testcase_16 AC 117 ms
55,852 KB
testcase_17 AC 123 ms
55,636 KB
testcase_18 AC 123 ms
55,900 KB
testcase_19 AC 123 ms
55,828 KB
testcase_20 AC 124 ms
55,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[][] map = new int[9][9];
		map[1][7] = 1;
		map[2][8] = 2;
		map[6][8] = 3;
		for (int i = 0; i < N; ++i) {
			int x0 = sc.nextInt();
			int y0 = sc.nextInt();
			int x1 = sc.nextInt();
			int y1 = sc.nextInt();
			--x0;
			--y0;
			--x1;
			--y1;
			map[x1][y1] = map[x0][y0];
			map[x0][y0] = 0;
		}
		if (map[4][7] == 1 && map[3][7] == 2 && map[5][7] == 3) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0