結果

問題 No.1479 Matrix Eraser
ユーザー 沙耶花沙耶花
提出日時 2021-04-16 20:23:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 595 bytes
コンパイル時間 4,550 ms
コンパイル使用メモリ 265,976 KB
実行使用メモリ 74,616 KB
最終ジャッジ日時 2023-09-15 21:02:43
合計ジャッジ時間 12,561 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
49,972 KB
testcase_01 AC 23 ms
50,088 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 48 ms
52,964 KB
testcase_08 AC 68 ms
55,080 KB
testcase_09 AC 133 ms
60,840 KB
testcase_10 AC 266 ms
70,124 KB
testcase_11 AC 156 ms
62,320 KB
testcase_12 AC 55 ms
53,756 KB
testcase_13 AC 69 ms
55,104 KB
testcase_14 AC 58 ms
53,584 KB
testcase_15 AC 28 ms
50,888 KB
testcase_16 AC 61 ms
54,148 KB
testcase_17 AC 320 ms
74,352 KB
testcase_18 AC 321 ms
74,228 KB
testcase_19 AC 323 ms
74,340 KB
testcase_20 AC 321 ms
74,244 KB
testcase_21 AC 322 ms
74,384 KB
testcase_22 AC 325 ms
74,180 KB
testcase_23 AC 321 ms
74,324 KB
testcase_24 AC 321 ms
74,344 KB
testcase_25 AC 325 ms
74,200 KB
testcase_26 AC 322 ms
74,184 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 77 ms
50,948 KB
testcase_33 AC 77 ms
50,968 KB
testcase_34 AC 81 ms
51,020 KB
testcase_35 AC 77 ms
50,996 KB
testcase_36 AC 78 ms
51,068 KB
testcase_37 AC 76 ms
50,996 KB
testcase_38 AC 295 ms
74,616 KB
testcase_39 AC 241 ms
74,412 KB
testcase_40 AC 24 ms
49,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int main(){
	
	int H,W;
	cin>>H>>W;
	
	vector<vector<int>> A(H,vector<int>(W));
	
	vector<set<int>> Sh(500001),Sw(500001);
	
	rep(i,H){
		rep(j,W){
			cin>>A[i][j];
			
			Sh[A[i][j]].insert(i);
			Sw[A[i][j]].insert(j);
			
		}
	}
	
	int ans = 0;
	
	rep(i,Sh.size()){
		if(i==0)continue;
		ans += min((int)Sh[i].size(),(int)Sw[i].size());
	}
	
	cout<<ans<<endl;
	
    return 0;
}
0