結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-03-20 18:41:23 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 41 ms / 5,000 ms | 
| コード長 | 283 bytes | 
| コンパイル時間 | 155 ms | 
| コンパイル使用メモリ | 82,360 KB | 
| 実行使用メモリ | 54,368 KB | 
| 最終ジャッジ日時 | 2025-03-20 18:41:42 | 
| 合計ジャッジ時間 | 1,598 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
w = int(input())
h = int(input())
n = int(input())
suits = set()
numbers = set()
for _ in range(n):
    s, k = map(int, input().split())
    suits.add(s)
    numbers.add(k)
s_count = len(suits)
k_count = len(numbers)
a = s_count * h + k_count * w - s_count * k_count
print(a - n)
            
            
            
        