結果

問題 No.2094 Symmetry
ユーザー a aa a
提出日時 2022-10-11 08:29:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 47,732 KB
最終ジャッジ日時 2023-09-07 10:09:27
合計ジャッジ時間 12,841 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
29,140 KB
testcase_01 AC 136 ms
29,172 KB
testcase_02 AC 135 ms
29,308 KB
testcase_03 AC 135 ms
29,364 KB
testcase_04 AC 135 ms
29,376 KB
testcase_05 AC 134 ms
29,276 KB
testcase_06 AC 134 ms
29,316 KB
testcase_07 AC 134 ms
29,464 KB
testcase_08 AC 135 ms
29,380 KB
testcase_09 AC 281 ms
47,240 KB
testcase_10 AC 276 ms
47,404 KB
testcase_11 AC 285 ms
47,220 KB
testcase_12 AC 279 ms
47,304 KB
testcase_13 AC 261 ms
45,100 KB
testcase_14 AC 281 ms
47,304 KB
testcase_15 AC 286 ms
47,384 KB
testcase_16 AC 281 ms
47,216 KB
testcase_17 AC 261 ms
45,296 KB
testcase_18 AC 264 ms
44,948 KB
testcase_19 AC 280 ms
47,672 KB
testcase_20 AC 284 ms
47,408 KB
testcase_21 AC 283 ms
47,368 KB
testcase_22 AC 279 ms
47,584 KB
testcase_23 AC 265 ms
45,600 KB
testcase_24 AC 265 ms
45,140 KB
testcase_25 AC 276 ms
47,404 KB
testcase_26 AC 275 ms
47,420 KB
testcase_27 AC 133 ms
29,372 KB
testcase_28 AC 242 ms
47,560 KB
testcase_29 AC 132 ms
29,176 KB
testcase_30 AC 237 ms
47,384 KB
testcase_31 AC 258 ms
47,728 KB
testcase_32 AC 262 ms
47,732 KB
testcase_33 AC 133 ms
29,416 KB
testcase_34 AC 238 ms
44,068 KB
testcase_35 AC 235 ms
43,496 KB
testcase_36 AC 244 ms
44,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n,k=list(map(int,input().split()))
s=[]
c=[]
for i in range(n*2):
    s.extend(list(input()))
for j in range(n*2):
    c.append(list(map(int,input().split())))
b=s.count("#")
m=np.array(c)
o=np.sort(m.ravel())[::-1]
os=sum(o[:b])
if b%2==1:
    print(os)
else:
    p=m[:,:n]+m[:,n:2*n][:,::-1]
    q=np.sort(p.ravel())[::-1]
    qs=sum(q[:b//2])+k
    print(max(qs,os))
0