結果

問題 No.1479 Matrix Eraser
ユーザー trineutrontrineutron
提出日時 2021-04-16 20:49:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 571 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 154,568 KB
最終ジャッジ日時 2023-09-15 22:05:05
合計ジャッジ時間 22,799 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,692 KB
testcase_01 AC 16 ms
7,924 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 121 ms
24,640 KB
testcase_08 AC 230 ms
36,948 KB
testcase_09 AC 528 ms
67,036 KB
testcase_10 AC 985 ms
104,596 KB
testcase_11 AC 605 ms
75,320 KB
testcase_12 AC 150 ms
28,788 KB
testcase_13 AC 225 ms
36,936 KB
testcase_14 AC 156 ms
29,580 KB
testcase_15 AC 44 ms
12,900 KB
testcase_16 AC 178 ms
31,328 KB
testcase_17 AC 1,296 ms
130,920 KB
testcase_18 AC 1,288 ms
130,892 KB
testcase_19 AC 1,269 ms
130,836 KB
testcase_20 AC 1,279 ms
130,884 KB
testcase_21 AC 1,277 ms
130,824 KB
testcase_22 AC 1,296 ms
130,796 KB
testcase_23 AC 1,292 ms
130,796 KB
testcase_24 AC 1,300 ms
130,780 KB
testcase_25 AC 1,332 ms
130,756 KB
testcase_26 AC 1,279 ms
130,920 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 202 ms
10,516 KB
testcase_33 AC 206 ms
10,672 KB
testcase_34 AC 205 ms
10,608 KB
testcase_35 AC 205 ms
10,664 KB
testcase_36 AC 209 ms
10,612 KB
testcase_37 AC 197 ms
10,544 KB
testcase_38 AC 291 ms
50,540 KB
testcase_39 AC 1,379 ms
154,568 KB
testcase_40 AC 15 ms
7,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
m_row = dict()
m_column = dict()
for i in range(h):
    for j in range(w):
        if a[i][j] not in m_row:
            m_row[a[i][j]] = set()
        if a[i][j] not in m_column:
            m_column[a[i][j]] = set()
        m_row[a[i][j]].add(i)
        m_column[a[i][j]].add(j)
ans = 0
for i in m_row:
    if i == 0:
        continue
    ans += min(len(m_row[i]), len(m_column[i]))
print(ans)
0