結果

問題 No.11 カードマッチ
ユーザー こるこる
提出日時 2017-01-07 10:39:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 440 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 815,004 KB
最終ジャッジ日時 2023-08-22 15:41:35
合計ジャッジ時間 7,704 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 15 ms
7,824 KB
testcase_03 AC 14 ms
7,776 KB
testcase_04 MLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

w=int(input())
h=int(input())
n=int(input())

array=[[0 for i in range(h+10)] for j in range(w+10)]
sum=0
for j in range(n):
    a,b=[int(i) for i in input().split()]
    if array[a][b]==1:
        sum-=1
    array[a][b]=-1
    for i in range(1,h+1):
        if array[a][i]==0: sum+=1
        if array[a][i]!=-1: array[a][i]=1
    for i in range(1,w+1):
        if array[i][b]==0: sum+=1
        if array[i][b]!=-1: array[i][b]=1
print(sum)
0