結果

問題 No.11 カードマッチ
ユーザー ssmkzkssmkzk
提出日時 2018-11-08 23:35:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 705 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 1,088 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 78,764 KB
最終ジャッジ日時 2023-08-13 04:34:33
合計ジャッジ時間 6,628 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,780 KB
testcase_01 AC 15 ms
7,812 KB
testcase_02 AC 15 ms
7,736 KB
testcase_03 AC 15 ms
7,784 KB
testcase_04 AC 462 ms
60,440 KB
testcase_05 AC 15 ms
7,784 KB
testcase_06 AC 689 ms
78,764 KB
testcase_07 AC 25 ms
9,584 KB
testcase_08 AC 265 ms
39,340 KB
testcase_09 AC 705 ms
78,680 KB
testcase_10 AC 518 ms
61,088 KB
testcase_11 AC 407 ms
52,196 KB
testcase_12 AC 412 ms
52,840 KB
testcase_13 AC 312 ms
42,660 KB
testcase_14 AC 332 ms
45,888 KB
testcase_15 AC 18 ms
8,400 KB
testcase_16 AC 16 ms
8,232 KB
testcase_17 AC 16 ms
7,776 KB
testcase_18 AC 17 ms
8,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

W = int(input())
H = int(input())
N = int(input())
l = [[] for i in range(W)]
s = set([])

for i in range(N):
    mark, num = map(int, input().split())
    l[mark - 1].append(num)
    s.add(num)

s_len = len(s)
ans = 0
for l_i in l:
    if len(l_i) == 0:
        ans += s_len
    else:
        ans += H - len(l_i)
print(ans)
0