結果

問題 No.11 カードマッチ
ユーザー lloyzlloyz
提出日時 2022-02-01 20:24:45
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 258 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 8,624 KB
最終ジャッジ日時 2023-09-02 02:34:45
合計ジャッジ時間 1,442 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,484 KB
testcase_01 AC 18 ms
8,428 KB
testcase_02 AC 18 ms
8,544 KB
testcase_03 AC 17 ms
8,508 KB
testcase_04 AC 16 ms
8,608 KB
testcase_05 AC 16 ms
8,536 KB
testcase_06 AC 17 ms
8,432 KB
testcase_07 AC 17 ms
8,520 KB
testcase_08 AC 17 ms
8,584 KB
testcase_09 AC 16 ms
8,440 KB
testcase_10 AC 17 ms
8,520 KB
testcase_11 AC 16 ms
8,572 KB
testcase_12 AC 17 ms
8,528 KB
testcase_13 AC 18 ms
8,504 KB
testcase_14 AC 17 ms
8,624 KB
testcase_15 AC 17 ms
8,572 KB
testcase_16 AC 17 ms
8,540 KB
testcase_17 AC 16 ms
8,552 KB
testcase_18 AC 16 ms
8,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

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

M, K = set(), set()
for _ in range(n):
    m, k = map(int, input().split())
    M.add(m)
    K.add(k)

print(len(M) * h + len(K) * w - len(M) * len(K) - n)
0