結果

問題 No.11 カードマッチ
ユーザー NacoNaco
提出日時 2019-10-20 02:17:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 395 bytes
コンパイル時間 1,845 ms
コンパイル使用メモリ 172,816 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 10:44:37
合計ジャッジ時間 2,605 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    int W,H,N; cin >> W >> H >> N;
    map<int,int> S,K;
    long long ans=0;
    for(int i=0;i<N;i++){
        int x,y; cin >> x >> y;
        S[x]++;
        K[y]++;
    }
    for(auto it=S.begin();it!=S.end();it++){
        ans+=H-it->second;
    }
    //cout << ans << endl;
    ans+=K.size()*(W-S.size());
    cout << ans << endl;
}
0