結果

問題 No.11 カードマッチ
ユーザー KudeKude
提出日時 2020-09-03 09:09:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 5,000 ms
コード長 269 bytes
コンパイル時間 841 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 90,888 KB
最終ジャッジ日時 2023-08-14 20:03:25
合計ジャッジ時間 3,724 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,200 KB
testcase_01 AC 77 ms
70,976 KB
testcase_02 AC 75 ms
71,260 KB
testcase_03 AC 75 ms
71,336 KB
testcase_04 AC 92 ms
81,784 KB
testcase_05 AC 75 ms
71,396 KB
testcase_06 AC 107 ms
90,888 KB
testcase_07 AC 84 ms
80,532 KB
testcase_08 AC 93 ms
83,360 KB
testcase_09 AC 107 ms
90,880 KB
testcase_10 AC 101 ms
87,772 KB
testcase_11 AC 99 ms
86,568 KB
testcase_12 AC 98 ms
87,092 KB
testcase_13 AC 97 ms
86,224 KB
testcase_14 AC 89 ms
81,156 KB
testcase_15 AC 77 ms
75,256 KB
testcase_16 AC 76 ms
75,844 KB
testcase_17 AC 80 ms
75,912 KB
testcase_18 AC 80 ms
75,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w = int(input())
h = int(input())
n = int(input())
havew = [False] * w
haveh = [False] * h
for _ in range(n):
    s, k = map(int, input().split())
    havew[s-1] = True
    haveh[k-1] = True
sw = sum(havew)
sh = sum(haveh)
ans = sw * h + sh * w - sw * sh - n
print(ans)
0