結果

問題 No.11 カードマッチ
ユーザー titiatitia
提出日時 2021-11-02 03:57:38
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 63 ms / 5,000 ms
コード長 225 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 23,688 KB
最終ジャッジ日時 2023-08-01 09:06:06
合計ジャッジ時間 2,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 15 ms
7,816 KB
testcase_04 AC 38 ms
14,560 KB
testcase_05 AC 16 ms
7,848 KB
testcase_06 AC 63 ms
23,388 KB
testcase_07 AC 32 ms
13,188 KB
testcase_08 AC 41 ms
16,120 KB
testcase_09 AC 62 ms
23,688 KB
testcase_10 AC 53 ms
20,664 KB
testcase_11 AC 49 ms
19,240 KB
testcase_12 AC 52 ms
19,872 KB
testcase_13 AC 49 ms
18,752 KB
testcase_14 AC 35 ms
13,948 KB
testcase_15 AC 16 ms
7,784 KB
testcase_16 AC 18 ms
8,464 KB
testcase_17 AC 19 ms
8,568 KB
testcase_18 AC 18 ms
8,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

W=int(input())
H=int(input())
N=int(input())

M=[0]*W
M2=[0]*H

for i in range(N):
    s,k=map(int,input().split())
    s-=1
    k-=1
    M[s]=1
    M2[k]=1


m=M.count(1)
m2=M2.count(1)

ANS=m*H+m2*W-m*m2-N

print(ANS)
    
0