結果

問題 No.1479 Matrix Eraser
ユーザー jutamajutama
提出日時 2021-04-16 21:26:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,186 bytes
コンパイル時間 3,365 ms
コンパイル使用メモリ 177,012 KB
実行使用メモリ 69,864 KB
最終ジャッジ日時 2023-09-15 23:29:58
合計ジャッジ時間 14,801 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 48 ms
10,988 KB
testcase_08 AC 106 ms
16,360 KB
testcase_09 AC 268 ms
29,264 KB
testcase_10 AC 566 ms
48,296 KB
testcase_11 AC 332 ms
33,396 KB
testcase_12 AC 69 ms
13,060 KB
testcase_13 AC 101 ms
16,260 KB
testcase_14 AC 73 ms
13,504 KB
testcase_15 AC 13 ms
5,880 KB
testcase_16 AC 87 ms
14,624 KB
testcase_17 AC 678 ms
55,720 KB
testcase_18 AC 685 ms
55,752 KB
testcase_19 AC 674 ms
55,848 KB
testcase_20 AC 709 ms
55,804 KB
testcase_21 AC 708 ms
55,728 KB
testcase_22 AC 705 ms
55,656 KB
testcase_23 AC 688 ms
55,648 KB
testcase_24 AC 679 ms
55,752 KB
testcase_25 AC 664 ms
55,984 KB
testcase_26 AC 725 ms
55,824 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 19 ms
4,380 KB
testcase_33 AC 19 ms
4,376 KB
testcase_34 AC 19 ms
4,376 KB
testcase_35 AC 19 ms
4,380 KB
testcase_36 AC 19 ms
4,380 KB
testcase_37 AC 16 ms
4,380 KB
testcase_38 AC 57 ms
4,380 KB
testcase_39 AC 388 ms
69,864 KB
testcase_40 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bitset>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using namespace atcoder;

//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *//

void input() {
    
    
}


void solve() {
    
    
    int H, W; cin >> H >> W;
    set<int> As;
    map<int, bitset<500>> Ac, Ar;
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            int A; cin >> A;
            As.insert(A);
            Ac[A].set(i);
            Ar[A].set(j);
        }
    }
    
    int ans = 0;
    for(auto a : As) {
        if(a == 0) continue;
        ans += min(Ac[a].count(), Ar[a].count());
    }
    cout << ans << endl;
    
    
    
    
    
}

//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *//

int main() {
    
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
    std::cin.tie(0);
    ios::sync_with_stdio(false);
    
    input();
    solve();
    
    return 0;
}
0