結果

問題 No.11 カードマッチ
ユーザー kohei2019kohei2019
提出日時 2021-02-03 09:44:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 90,540 KB
最終ジャッジ日時 2023-09-12 11:46:11
合計ジャッジ時間 3,105 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,296 KB
testcase_01 AC 77 ms
71,220 KB
testcase_02 AC 77 ms
71,340 KB
testcase_03 AC 75 ms
71,108 KB
testcase_04 AC 97 ms
81,548 KB
testcase_05 AC 78 ms
71,112 KB
testcase_06 AC 117 ms
90,240 KB
testcase_07 AC 93 ms
80,048 KB
testcase_08 AC 101 ms
82,924 KB
testcase_09 AC 117 ms
90,540 KB
testcase_10 AC 110 ms
87,476 KB
testcase_11 AC 106 ms
86,108 KB
testcase_12 AC 109 ms
86,796 KB
testcase_13 AC 107 ms
85,868 KB
testcase_14 AC 96 ms
80,836 KB
testcase_15 AC 80 ms
74,956 KB
testcase_16 AC 82 ms
75,404 KB
testcase_17 AC 82 ms
75,544 KB
testcase_18 AC 82 ms
75,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

W = int(input())
H = int(input())
N = int(input())
lssk = [list(map(int,input().split())) for i in range(N)]
lsW = [False]*(W+1)
lsH = [False]*(H+1)
for i in range(N):
    w,h = lssk[i][0],lssk[i][1]
    lsW[w] = True
    lsH[h] = True
print(lsW.count(True)*H+lsH.count(True)*W-lsW.count(True)*lsH.count(True)-N)
0