結果

問題 No.923 オセロきりきざむたん
ユーザー 👑 tamatotamato
提出日時 2019-11-08 22:16:01
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,128 KB
実行使用メモリ 84,720 KB
最終ジャッジ日時 2023-10-13 05:31:14
合計ジャッジ時間 9,825 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,480 KB
testcase_01 AC 68 ms
71,156 KB
testcase_02 AC 70 ms
71,304 KB
testcase_03 AC 68 ms
71,432 KB
testcase_04 AC 69 ms
71,448 KB
testcase_05 AC 68 ms
71,564 KB
testcase_06 AC 69 ms
71,340 KB
testcase_07 AC 70 ms
71,480 KB
testcase_08 AC 69 ms
71,160 KB
testcase_09 AC 69 ms
71,312 KB
testcase_10 AC 68 ms
71,328 KB
testcase_11 AC 69 ms
71,304 KB
testcase_12 AC 69 ms
71,344 KB
testcase_13 AC 69 ms
71,108 KB
testcase_14 AC 68 ms
71,304 KB
testcase_15 AC 68 ms
71,440 KB
testcase_16 AC 69 ms
71,112 KB
testcase_17 AC 67 ms
71,524 KB
testcase_18 AC 69 ms
71,408 KB
testcase_19 AC 70 ms
71,104 KB
testcase_20 AC 73 ms
75,832 KB
testcase_21 AC 69 ms
71,244 KB
testcase_22 AC 73 ms
75,884 KB
testcase_23 AC 74 ms
75,904 KB
testcase_24 AC 69 ms
71,336 KB
testcase_25 AC 74 ms
76,364 KB
testcase_26 AC 82 ms
76,388 KB
testcase_27 AC 77 ms
76,448 KB
testcase_28 AC 77 ms
76,364 KB
testcase_29 AC 78 ms
76,552 KB
testcase_30 AC 75 ms
76,016 KB
testcase_31 AC 77 ms
76,616 KB
testcase_32 AC 73 ms
75,616 KB
testcase_33 AC 73 ms
75,624 KB
testcase_34 AC 74 ms
75,748 KB
testcase_35 AC 75 ms
75,800 KB
testcase_36 AC 74 ms
75,908 KB
testcase_37 AC 71 ms
75,976 KB
testcase_38 AC 73 ms
76,076 KB
testcase_39 AC 73 ms
76,356 KB
testcase_40 AC 73 ms
75,752 KB
testcase_41 AC 71 ms
75,824 KB
testcase_42 AC 73 ms
75,916 KB
testcase_43 AC 71 ms
75,836 KB
testcase_44 AC 74 ms
75,896 KB
testcase_45 AC 74 ms
75,780 KB
testcase_46 AC 76 ms
76,480 KB
testcase_47 AC 76 ms
75,916 KB
testcase_48 AC 74 ms
75,956 KB
testcase_49 AC 72 ms
75,668 KB
testcase_50 AC 83 ms
76,584 KB
testcase_51 AC 83 ms
76,652 KB
testcase_52 AC 83 ms
76,328 KB
testcase_53 AC 92 ms
79,756 KB
testcase_54 AC 83 ms
76,792 KB
testcase_55 AC 84 ms
76,836 KB
testcase_56 AC 84 ms
76,788 KB
testcase_57 AC 77 ms
76,492 KB
testcase_58 AC 76 ms
76,536 KB
testcase_59 AC 77 ms
76,508 KB
testcase_60 AC 76 ms
76,708 KB
testcase_61 AC 73 ms
75,892 KB
testcase_62 AC 75 ms
75,792 KB
testcase_63 AC 74 ms
76,440 KB
testcase_64 AC 74 ms
76,024 KB
testcase_65 AC 98 ms
81,724 KB
testcase_66 AC 107 ms
82,988 KB
testcase_67 AC 110 ms
84,720 KB
testcase_68 AC 106 ms
84,560 KB
testcase_69 AC 73 ms
76,380 KB
testcase_70 AC 73 ms
76,272 KB
testcase_71 AC 108 ms
84,556 KB
testcase_72 AC 73 ms
76,276 KB
testcase_73 AC 74 ms
76,336 KB
testcase_74 AC 74 ms
76,244 KB
testcase_75 AC 77 ms
76,076 KB
testcase_76 AC 73 ms
76,416 KB
testcase_77 AC 77 ms
76,568 KB
testcase_78 AC 75 ms
76,600 KB
testcase_79 AC 76 ms
75,884 KB
testcase_80 AC 78 ms
76,620 KB
testcase_81 AC 79 ms
75,964 KB
testcase_82 AC 78 ms
76,616 KB
testcase_83 AC 72 ms
76,456 KB
testcase_84 AC 78 ms
76,600 KB
testcase_85 AC 77 ms
76,104 KB
testcase_86 AC 75 ms
76,272 KB
testcase_87 AC 74 ms
76,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

h, w = map(int, input().split())
grid = []
for _ in range(h):
    line = input().rstrip('\n')
    grid.append(line)

flg_h0 = 0
flg_h1 = 0
flg_w0 = 0
flg_w1 = 0
# print(grid)
for i in range(h):
    if grid[i].count('0') == 0:
        flg_h1 = 1
    if grid[i].count('0') == w:
        flg_h0 = 1
for i in range(w):
    cnt = 0
    for j in range(h):
        if grid[j][i] == '0':
            cnt += 1
    if cnt == 0:
        flg_w1 = 1
    if cnt == h:
        flg_w0 = 1

# print(flg_w0, flg_w1, flg_h0, flg_h1)

if flg_h0 and flg_w0:
    print('NO')
elif flg_h1 and flg_w1:
    print('NO')
else:
    print('YES')
0