結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 139 ms
29,264 KB
testcase_03 WA -
testcase_04 AC 142 ms
29,176 KB
testcase_05 AC 140 ms
29,316 KB
testcase_06 AC 138 ms
28,936 KB
testcase_07 AC 136 ms
29,116 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 272 ms
45,512 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 273 ms
45,128 KB
testcase_18 AC 281 ms
45,152 KB
testcase_19 AC 291 ms
47,540 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 290 ms
47,420 KB
testcase_23 AC 271 ms
45,288 KB
testcase_24 AC 271 ms
45,348 KB
testcase_25 WA -
testcase_26 AC 289 ms
47,508 KB
testcase_27 AC 138 ms
29,228 KB
testcase_28 AC 245 ms
47,756 KB
testcase_29 AC 140 ms
29,220 KB
testcase_30 AC 250 ms
47,476 KB
testcase_31 AC 275 ms
47,344 KB
testcase_32 AC 275 ms
47,544 KB
testcase_33 AC 141 ms
29,028 KB
testcase_34 AC 244 ms
44,040 KB
testcase_35 AC 244 ms
43,604 KB
testcase_36 AC 251 ms
43,952 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