結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  rgnerdplayer | 
| 提出日時 | 2025-05-01 02:31:46 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 515 bytes | 
| コンパイル時間 | 4,841 ms | 
| コンパイル使用メモリ | 276,848 KB | 
| 実行使用メモリ | 6,272 KB | 
| 最終ジャッジ日時 | 2025-05-01 02:31:53 | 
| 合計ジャッジ時間 | 5,207 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    auto solve = [&]() {
        int w, h, n;
        cin >> w >> h >> n;
        set<int> x, y;
        for (int i = 0; i < n; i++) {
            int a, b;
            cin >> a >> b;
            x.insert(a), y.insert(b);
        }
        i64 ans = 1LL * w * h - 1LL * (w - x.size()) * (h - y.size()) - n;
        cout << ans << '\n';
    };
    
    solve();
    
    return 0;
}
            
            
            
        