結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-08-02 14:18:17 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 385 bytes | 
| コンパイル時間 | 1,655 ms | 
| コンパイル使用メモリ | 196,612 KB | 
| 最終ジャッジ日時 | 2025-01-07 10:32:16 | 
| ジャッジサーバーID (参考情報) | judge5 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 WA * 18 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll w, h, n;
    cin>>w>>h>>n;
    set<ll> suits;
    set<ll> nums;
    for (int i=0; i < n; i++) {
        ll s, k;
        cin>>s>>k;
        suits.insert(s);
        nums.insert(k);
    }
    ll ns = suits.size();
    ll nn = nums.size();
    cout << ns*nn + (w-ns)*nn - n << endl;
    return 0;
}
            
            
            
        