結果

問題 No.11 カードマッチ
ユーザー JunOnumaJunOnuma
提出日時 2017-06-14 13:55:25
言語 Python2
(2.7.18)
結果
AC  
実行時間 253 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 7,092 KB
実行使用メモリ 61,272 KB
最終ジャッジ日時 2023-10-25 01:21:01
合計ジャッジ時間 3,014 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,392 KB
testcase_01 AC 12 ms
6,392 KB
testcase_02 AC 12 ms
6,392 KB
testcase_03 AC 11 ms
6,392 KB
testcase_04 AC 119 ms
35,572 KB
testcase_05 AC 11 ms
6,392 KB
testcase_06 AC 253 ms
61,272 KB
testcase_07 AC 96 ms
32,324 KB
testcase_08 AC 138 ms
36,364 KB
testcase_09 AC 249 ms
61,272 KB
testcase_10 AC 203 ms
52,280 KB
testcase_11 AC 185 ms
43,984 KB
testcase_12 AC 193 ms
52,148 KB
testcase_13 AC 181 ms
49,856 KB
testcase_14 AC 106 ms
27,736 KB
testcase_15 AC 12 ms
6,540 KB
testcase_16 AC 22 ms
9,240 KB
testcase_17 AC 22 ms
9,376 KB
testcase_18 AC 21 ms
9,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w = int(raw_input())
lw = [False for _ in range(w)]
h = int(raw_input())
lh = [False for _ in range(h)]
n = int(raw_input())
c = 0
for _ in range(n):
    s,k = map(int, raw_input().split())
    lw[s-1] = True
    lh[k-1] = True
wt = lw.count(True)
ht = lh.count(True)
print wt * h - n + (w-wt) * ht
0