結果

問題 No.923 オセロきりきざむたん
ユーザー ks2mks2m
提出日時 2019-11-08 23:03:10
言語 Java19
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 1,244 bytes
コンパイル時間 2,310 ms
コンパイル使用メモリ 73,468 KB
実行使用メモリ 57,476 KB
最終ジャッジ日時 2023-10-13 05:34:38
合計ジャッジ時間 10,247 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,192 KB
testcase_01 AC 41 ms
49,200 KB
testcase_02 AC 41 ms
49,136 KB
testcase_03 AC 41 ms
49,336 KB
testcase_04 AC 42 ms
49,472 KB
testcase_05 AC 41 ms
49,488 KB
testcase_06 AC 42 ms
49,320 KB
testcase_07 AC 42 ms
49,496 KB
testcase_08 AC 41 ms
49,412 KB
testcase_09 AC 42 ms
49,212 KB
testcase_10 AC 41 ms
49,356 KB
testcase_11 AC 41 ms
49,244 KB
testcase_12 AC 41 ms
49,260 KB
testcase_13 AC 42 ms
49,420 KB
testcase_14 AC 41 ms
49,452 KB
testcase_15 AC 41 ms
49,248 KB
testcase_16 AC 42 ms
49,236 KB
testcase_17 AC 41 ms
49,096 KB
testcase_18 AC 42 ms
49,208 KB
testcase_19 AC 42 ms
49,420 KB
testcase_20 AC 44 ms
49,612 KB
testcase_21 AC 42 ms
49,184 KB
testcase_22 AC 43 ms
49,212 KB
testcase_23 AC 42 ms
49,196 KB
testcase_24 AC 41 ms
49,240 KB
testcase_25 AC 43 ms
49,324 KB
testcase_26 AC 89 ms
52,412 KB
testcase_27 AC 82 ms
52,640 KB
testcase_28 AC 79 ms
51,676 KB
testcase_29 AC 75 ms
52,092 KB
testcase_30 AC 53 ms
49,948 KB
testcase_31 AC 78 ms
51,632 KB
testcase_32 AC 44 ms
49,416 KB
testcase_33 AC 43 ms
49,196 KB
testcase_34 AC 43 ms
49,252 KB
testcase_35 AC 44 ms
49,720 KB
testcase_36 AC 44 ms
49,240 KB
testcase_37 AC 44 ms
49,108 KB
testcase_38 AC 44 ms
49,372 KB
testcase_39 AC 42 ms
49,292 KB
testcase_40 AC 43 ms
49,428 KB
testcase_41 AC 42 ms
49,300 KB
testcase_42 AC 43 ms
49,200 KB
testcase_43 AC 43 ms
49,308 KB
testcase_44 AC 43 ms
49,388 KB
testcase_45 AC 48 ms
50,088 KB
testcase_46 AC 45 ms
49,100 KB
testcase_47 AC 48 ms
50,128 KB
testcase_48 AC 42 ms
49,372 KB
testcase_49 AC 42 ms
49,328 KB
testcase_50 AC 82 ms
54,596 KB
testcase_51 AC 91 ms
54,680 KB
testcase_52 AC 97 ms
52,580 KB
testcase_53 AC 110 ms
55,188 KB
testcase_54 AC 96 ms
54,860 KB
testcase_55 AC 102 ms
54,980 KB
testcase_56 AC 102 ms
54,840 KB
testcase_57 AC 44 ms
49,296 KB
testcase_58 AC 43 ms
49,476 KB
testcase_59 AC 44 ms
49,284 KB
testcase_60 AC 44 ms
49,300 KB
testcase_61 AC 43 ms
49,596 KB
testcase_62 AC 50 ms
50,168 KB
testcase_63 AC 43 ms
49,236 KB
testcase_64 AC 44 ms
49,216 KB
testcase_65 AC 125 ms
55,684 KB
testcase_66 AC 127 ms
57,472 KB
testcase_67 AC 127 ms
55,652 KB
testcase_68 AC 126 ms
57,476 KB
testcase_69 AC 73 ms
51,976 KB
testcase_70 AC 65 ms
50,348 KB
testcase_71 AC 128 ms
57,352 KB
testcase_72 AC 74 ms
52,328 KB
testcase_73 AC 43 ms
49,572 KB
testcase_74 AC 48 ms
49,580 KB
testcase_75 AC 81 ms
51,840 KB
testcase_76 AC 52 ms
50,284 KB
testcase_77 AC 75 ms
50,468 KB
testcase_78 AC 45 ms
49,256 KB
testcase_79 AC 82 ms
51,580 KB
testcase_80 AC 76 ms
50,328 KB
testcase_81 AC 69 ms
51,740 KB
testcase_82 AC 80 ms
51,948 KB
testcase_83 AC 53 ms
50,100 KB
testcase_84 AC 91 ms
52,496 KB
testcase_85 AC 77 ms
51,880 KB
testcase_86 AC 59 ms
50,368 KB
testcase_87 AC 59 ms
50,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int h = Integer.parseInt(sa[0]);
		int w = Integer.parseInt(sa[1]);
		char[][] a = new char[h][w];
		for (int i = 0; i < h; i++) {
			a[i] = br.readLine().toCharArray();
		}
		br.close();

		boolean[] h0 = new boolean[h];
		boolean[] h1 = new boolean[h];
		for (int i = 0; i < h; i++) {
			boolean f0 = true;
			boolean f1 = true;
			for (int j = 0; j < w; j++) {
				if (a[i][j] == '0') {
					f1 = false;
				} else {
					f0 = false;
				}
			}
			h0[i] = f0;
			h1[i] = f1;
		}

		boolean[] w0 = new boolean[w];
		boolean[] w1 = new boolean[w];
		for (int j = 0; j < w; j++) {
			boolean f0 = true;
			boolean f1 = true;
			for (int i = 0; i < h; i++) {
				if (a[i][j] == '0') {
					f1 = false;
				} else {
					f0 = false;
				}
			}
			w0[j] = f0;
			w1[j] = f1;
		}

		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (h0[i] && w0[j] || h1[i] && w1[j]) {
					System.out.println("NO");
					return;
				}
			}
		}
		System.out.println("YES");
	}
}
0