結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  nsd_fb | 
| 提出日時 | 2015-02-19 06:56:41 | 
| 言語 | Python2 (2.7.18) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 12 ms / 5,000 ms | 
| コード長 | 381 bytes | 
| コンパイル時間 | 168 ms | 
| コンパイル使用メモリ | 7,040 KB | 
| 実行使用メモリ | 6,272 KB | 
| 最終ジャッジ日時 | 2024-10-11 19:43:07 | 
| 合計ジャッジ時間 | 1,039 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
def increment(dic, key):
    if key in dic:
        dic[key] += 1
    else:
        dic[key] = 1
w = input()
h = input()
n = input()
hor = {}
ver = {}
for i in xrange(n):
    x, y = map(int, raw_input().split())
    increment(hor, y)
    increment(ver, x)
ans = 0
for num in hor.itervalues():
    ans += w - num
for num in ver.itervalues():
    ans += h - len(hor)
print ans
            
            
            
        