結果

問題 No.11 カードマッチ
ユーザー ciirociiro
提出日時 2021-12-11 23:11:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 26,368 KB
最終ジャッジ日時 2024-07-20 06:29:58
合計ジャッジ時間 1,704 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

w = int(input())
h = int(input())
n = int(input())

wc , hc = 0 , 0
wl = [0] * (w + 1)
hl = [0] * (h + 1)
for i in range(n):
	s,k = map(int,input().split())
	if wl[s] == 0:
		wl[s] = 1
	if hl[k] == 0:
		hl[k] = 1

ws , hs = sum(wl) , sum(hl)

print(h * ws + w * hs - ws * hs - n)
0