結果
| 問題 | No.11 カードマッチ |
| コンテスト | |
| ユーザー |
nsd_fb
|
| 提出日時 | 2015-02-19 06:56:41 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 94 ms / 5,000 ms |
| コード長 | 381 bytes |
| 記録 | |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 77,492 KB |
| 最終ジャッジ日時 | 2025-12-03 14:01:35 |
|
ジャッジサーバーID (参考情報) |
judge5 / 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
nsd_fb