結果

問題 No.11 カードマッチ
ユーザー roarisroaris
提出日時 2019-12-13 20:24:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 278 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 83,532 KB
最終ジャッジ日時 2023-09-09 22:07:00
合計ジャッジ時間 3,653 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,200 KB
testcase_01 AC 73 ms
71,088 KB
testcase_02 AC 71 ms
71,280 KB
testcase_03 AC 71 ms
71,312 KB
testcase_04 AC 83 ms
81,300 KB
testcase_05 AC 69 ms
70,892 KB
testcase_06 AC 79 ms
83,420 KB
testcase_07 AC 74 ms
75,672 KB
testcase_08 AC 78 ms
79,212 KB
testcase_09 AC 80 ms
83,532 KB
testcase_10 AC 78 ms
81,588 KB
testcase_11 AC 79 ms
80,464 KB
testcase_12 AC 80 ms
80,648 KB
testcase_13 AC 77 ms
79,520 KB
testcase_14 AC 79 ms
79,904 KB
testcase_15 AC 75 ms
75,420 KB
testcase_16 AC 80 ms
75,684 KB
testcase_17 AC 72 ms
71,068 KB
testcase_18 AC 74 ms
75,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

W = int(input())
H = int(input())
N = int(input())
cnt = [0]*W
s = set()

for _ in range(N):
    Si, Ki = map(int, input().split())
    Si -= 1
    cnt[Si] += 1
    s.add(Ki)
    
ans = 0

for c in cnt:
    if c==0:
        ans += len(s)
    else:
        ans += H-c

print(ans)
0