結果

問題 No.11 カードマッチ
ユーザー akanayaakanaya
提出日時 2020-03-31 14:47:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 86,664 KB
実行使用メモリ 90,256 KB
最終ジャッジ日時 2023-09-06 20:47:39
合計ジャッジ時間 3,360 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,176 KB
testcase_01 AC 74 ms
71,132 KB
testcase_02 AC 74 ms
71,212 KB
testcase_03 AC 75 ms
70,872 KB
testcase_04 AC 91 ms
81,320 KB
testcase_05 AC 71 ms
70,820 KB
testcase_06 AC 104 ms
90,256 KB
testcase_07 AC 89 ms
79,804 KB
testcase_08 AC 95 ms
82,688 KB
testcase_09 AC 108 ms
90,216 KB
testcase_10 AC 103 ms
87,332 KB
testcase_11 AC 103 ms
85,988 KB
testcase_12 AC 104 ms
86,460 KB
testcase_13 AC 104 ms
85,632 KB
testcase_14 AC 96 ms
80,536 KB
testcase_15 AC 83 ms
74,744 KB
testcase_16 AC 84 ms
75,204 KB
testcase_17 AC 83 ms
75,236 KB
testcase_18 AC 78 ms
75,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w = int(input())
h = int(input())
n = int(input())
skn = [None] * n
for i in range(n):
    skn[i] = list(map(int, input().split(' ')))


hc = [False] * h
wc = [False] * w
for sk in skn:
    wc[sk[0] - 1] = True
    hc[sk[1] - 1] = True


hcount = hc.count(True)
wcount = wc.count(True)

result = hcount * w + wcount * h - hcount * wcount - n
print(result)

0