結果

問題 No.11 カードマッチ
ユーザー konchanksukonchanksu
提出日時 2020-04-20 14:47:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 691 ms / 5,000 ms
コード長 396 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 196,280 KB
最終ジャッジ日時 2024-04-16 00:42:02
合計ジャッジ時間 5,968 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 31 ms
10,880 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 332 ms
94,176 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 681 ms
196,148 KB
testcase_07 AC 237 ms
53,728 KB
testcase_08 AC 360 ms
104,416 KB
testcase_09 AC 691 ms
196,280 KB
testcase_10 AC 581 ms
184,120 KB
testcase_11 AC 502 ms
154,464 KB
testcase_12 AC 516 ms
154,720 KB
testcase_13 AC 496 ms
150,288 KB
testcase_14 AC 275 ms
75,364 KB
testcase_15 AC 34 ms
11,520 KB
testcase_16 AC 55 ms
16,172 KB
testcase_17 AC 57 ms
16,088 KB
testcase_18 AC 56 ms
16,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w = int(input())
h = int(input())
n = int(input())
s, k = {i:0 for i in range(1, w + 1)}, {i:0 for i in range(1, h + 1)}
for i in range(n):
    te, mp = map(int, input().split())
    s[te] += 1
    k[mp] += 1
    
ans = 0
tmp = 0
for i in range(1, w + 1):
    if s[i] != 0:
        ans += h - s[i]
        tmp += 1

for i in range(1, h + 1):
    if k[i] != 0:
        ans += w - tmp

print(ans)

0