結果

問題 No.11 カードマッチ
ユーザー ciirociiro
提出日時 2021-12-11 23:11:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 279 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 23,716 KB
最終ジャッジ日時 2023-09-27 12:22:40
合計ジャッジ時間 1,548 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,836 KB
testcase_01 AC 13 ms
7,816 KB
testcase_02 AC 13 ms
7,836 KB
testcase_03 AC 14 ms
7,880 KB
testcase_04 AC 26 ms
14,840 KB
testcase_05 AC 14 ms
7,880 KB
testcase_06 AC 41 ms
23,716 KB
testcase_07 AC 23 ms
13,192 KB
testcase_08 AC 35 ms
15,992 KB
testcase_09 AC 44 ms
23,516 KB
testcase_10 AC 37 ms
20,656 KB
testcase_11 AC 37 ms
19,416 KB
testcase_12 AC 39 ms
19,824 KB
testcase_13 AC 38 ms
19,016 KB
testcase_14 AC 28 ms
14,064 KB
testcase_15 AC 15 ms
7,884 KB
testcase_16 AC 16 ms
8,472 KB
testcase_17 AC 15 ms
8,520 KB
testcase_18 AC 14 ms
8,580 KB
権限があれば一括ダウンロードができます

ソースコード

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