結果

問題 No.11 カードマッチ
ユーザー warashiwarashi
提出日時 2015-02-13 02:52:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 37 ms / 5,000 ms
コード長 430 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 26,240 KB
最終ジャッジ日時 2024-04-20 00:51:46
合計ジャッジ時間 1,472 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 26 ms
10,752 KB
testcase_04 AC 28 ms
17,288 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 37 ms
26,240 KB
testcase_07 AC 29 ms
16,016 KB
testcase_08 AC 33 ms
18,756 KB
testcase_09 AC 35 ms
26,188 KB
testcase_10 AC 32 ms
23,296 KB
testcase_11 AC 30 ms
21,856 KB
testcase_12 AC 32 ms
22,424 KB
testcase_13 AC 33 ms
21,456 KB
testcase_14 AC 31 ms
16,548 KB
testcase_15 AC 28 ms
10,752 KB
testcase_16 AC 27 ms
11,136 KB
testcase_17 AC 28 ms
11,392 KB
testcase_18 AC 27 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import itertools
import sys

W = int(input())
H = int(input())
N = int(input())
Shand = [False] * (W + 1)
Khand = [False] * (H + 1)
count = 0
Srest = W
Krest = H
Shand = []
Khand = []
for line in sys.stdin:
    S, K = map(int, line.split())
    if S not in Shand:
        Shand.append(S)
        Srest -= 1
    if K not in Khand:
        Khand.append(K)
        Krest -= 1

print(W * H - Srest * Krest - N)
0