結果
| 問題 | No.11 カードマッチ | 
| コンテスト | |
| ユーザー |  ゆるく | 
| 提出日時 | 2014-11-30 03:48:43 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 36 ms / 5,000 ms | 
| コード長 | 487 bytes | 
| コンパイル時間 | 101 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 11,520 KB | 
| 最終ジャッジ日時 | 2024-10-11 19:13:39 | 
| 合計ジャッジ時間 | 1,675 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 | 
ソースコード
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
w = int(input())
h = int(input())
n = int(input())
r = defaultdict(list)
for i in range(n):
  a,b = input().split()
  r[a].append(b)
c = defaultdict(int)
count = len(r) * h
for rr in r:
  for i in r[rr]:
    count -= 1
    c[i] = 1
count += (w - len(r)) * len(c)
print(count)
            
            
            
        