結果

問題 No.2094 Symmetry
ユーザー a aa a
提出日時 2022-10-11 07:57:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 979 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 47,980 KB
最終ジャッジ日時 2023-09-07 09:36:52
合計ジャッジ時間 12,588 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
29,656 KB
testcase_01 WA -
testcase_02 AC 134 ms
29,548 KB
testcase_03 WA -
testcase_04 AC 132 ms
29,604 KB
testcase_05 WA -
testcase_06 AC 130 ms
29,540 KB
testcase_07 AC 134 ms
29,656 KB
testcase_08 AC 134 ms
29,736 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 265 ms
45,316 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 270 ms
45,484 KB
testcase_18 AC 269 ms
45,272 KB
testcase_19 AC 281 ms
47,548 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 279 ms
47,588 KB
testcase_23 AC 270 ms
45,292 KB
testcase_24 AC 266 ms
45,356 KB
testcase_25 WA -
testcase_26 AC 278 ms
47,616 KB
testcase_27 AC 134 ms
29,756 KB
testcase_28 AC 237 ms
47,892 KB
testcase_29 AC 136 ms
29,648 KB
testcase_30 AC 243 ms
47,980 KB
testcase_31 AC 267 ms
47,792 KB
testcase_32 AC 258 ms
47,808 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 242 ms
43,948 KB
testcase_36 AC 245 ms
44,492 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