結果

問題 No.179 塗り分け
ユーザー 麻ch麻ch
提出日時 2023-05-28 01:04:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-08-27 01:57:28
合計ジャッジ時間 2,661 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 14 ms
7,748 KB
testcase_02 WA -
testcase_03 AC 13 ms
7,896 KB
testcase_04 WA -
testcase_05 AC 14 ms
7,832 KB
testcase_06 WA -
testcase_07 AC 14 ms
7,848 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 14 ms
7,884 KB
testcase_11 AC 14 ms
7,768 KB
testcase_12 AC 14 ms
7,900 KB
testcase_13 AC 15 ms
7,784 KB
testcase_14 AC 15 ms
7,816 KB
testcase_15 WA -
testcase_16 AC 15 ms
7,884 KB
testcase_17 AC 14 ms
7,768 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 14 ms
7,836 KB
testcase_21 AC 14 ms
7,740 KB
testcase_22 AC 14 ms
7,884 KB
testcase_23 WA -
testcase_24 AC 14 ms
7,812 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 13 ms
7,788 KB
testcase_28 WA -
testcase_29 AC 14 ms
7,840 KB
testcase_30 WA -
testcase_31 AC 15 ms
7,896 KB
testcase_32 WA -
testcase_33 AC 14 ms
7,848 KB
testcase_34 WA -
testcase_35 AC 14 ms
7,840 KB
testcase_36 AC 15 ms
7,816 KB
testcase_37 AC 14 ms
7,812 KB
testcase_38 AC 14 ms
7,832 KB
testcase_39 AC 14 ms
7,792 KB
testcase_40 AC 14 ms
7,772 KB
testcase_41 AC 14 ms
7,804 KB
testcase_42 AC 14 ms
7,812 KB
testcase_43 AC 14 ms
7,828 KB
testcase_44 AC 14 ms
7,816 KB
testcase_45 AC 14 ms
7,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 縦と横のマス数を取得
H, W = map(int, input().split())

# 各マスの状態を取得
grid = []
for _ in range(H):
    row = input()
    grid.append(row)

# 黒いマスの数を数える
black_count = sum(row.count("#") for row in grid)

# 黒いマスが存在しない場合、不可能
if black_count == 0:
    print("NO")
else:
    # 黒いマス全体を一つの領域として考える
    # 領域の面積が黒いマスの数と一致しているか判定
    if black_count == H * W:
        print("YES")
    else:
        print("NO")
0