結果

問題 No.11 カードマッチ
ユーザー kwnwsdnckwnwsdnc
提出日時 2018-04-02 13:50:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 409 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 10,840 KB
実行使用メモリ 23,604 KB
最終ジャッジ日時 2023-09-08 13:22:35
合計ジャッジ時間 2,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 16 ms
7,808 KB
testcase_02 AC 15 ms
7,776 KB
testcase_03 AC 16 ms
7,832 KB
testcase_04 AC 61 ms
14,884 KB
testcase_05 AC 16 ms
7,804 KB
testcase_06 AC 121 ms
23,596 KB
testcase_07 AC 53 ms
13,384 KB
testcase_08 AC 71 ms
16,228 KB
testcase_09 AC 122 ms
23,604 KB
testcase_10 AC 103 ms
20,740 KB
testcase_11 AC 93 ms
19,556 KB
testcase_12 AC 96 ms
20,084 KB
testcase_13 AC 91 ms
19,032 KB
testcase_14 AC 57 ms
14,208 KB
testcase_15 AC 16 ms
7,780 KB
testcase_16 AC 20 ms
8,592 KB
testcase_17 AC 21 ms
8,640 KB
testcase_18 AC 19 ms
8,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ln=[]
card=[]
for i in range(3):
    ln.append(int(input()))
for i in range(ln[2]):
    card.append(list(map(int,input().split())))

exist=[[0 for i in range(ln[j]+1)] for j in range(2)]

for i in range(2):
    for j in range(ln[2]):
        if exist[i][card[j][i]]==0:
            exist[i][card[j][i]]=1
            
n=ln[0]-exist[0].count(1)
m=ln[1]-exist[1].count(1)
ans=(ln[0]*ln[1]-n*m)-ln[2]
print(ans)
0