結果

問題 No.2094 Symmetry
ユーザー ああああ
提出日時 2022-10-12 20:08:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 219 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 110,144 KB
最終ジャッジ日時 2023-09-08 18:38:29
合計ジャッジ時間 11,162 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,136 KB
testcase_01 AC 70 ms
71,412 KB
testcase_02 AC 70 ms
71,364 KB
testcase_03 AC 70 ms
71,276 KB
testcase_04 AC 71 ms
71,280 KB
testcase_05 AC 70 ms
71,440 KB
testcase_06 AC 71 ms
71,356 KB
testcase_07 AC 70 ms
71,212 KB
testcase_08 AC 68 ms
71,168 KB
testcase_09 AC 211 ms
109,016 KB
testcase_10 AC 210 ms
108,888 KB
testcase_11 AC 216 ms
109,804 KB
testcase_12 AC 214 ms
109,480 KB
testcase_13 AC 216 ms
109,140 KB
testcase_14 AC 215 ms
109,536 KB
testcase_15 AC 216 ms
109,352 KB
testcase_16 AC 216 ms
109,068 KB
testcase_17 AC 217 ms
108,720 KB
testcase_18 AC 215 ms
108,756 KB
testcase_19 AC 215 ms
109,436 KB
testcase_20 AC 214 ms
109,784 KB
testcase_21 AC 219 ms
110,144 KB
testcase_22 AC 214 ms
108,536 KB
testcase_23 AC 216 ms
109,296 KB
testcase_24 AC 215 ms
109,288 KB
testcase_25 AC 219 ms
109,252 KB
testcase_26 AC 214 ms
109,140 KB
testcase_27 AC 75 ms
71,604 KB
testcase_28 AC 145 ms
105,180 KB
testcase_29 AC 71 ms
71,164 KB
testcase_30 AC 146 ms
105,080 KB
testcase_31 AC 151 ms
108,048 KB
testcase_32 AC 150 ms
108,100 KB
testcase_33 AC 72 ms
71,164 KB
testcase_34 AC 145 ms
96,920 KB
testcase_35 AC 148 ms
106,868 KB
testcase_36 AC 147 ms
107,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
S=[input() for _ in range(2*N)]
C=[list(map(int,input().split())) for _ in range(2*N)]

c=[]
black=0
sym=[]
for i in range(2*N):
    for j in range(2*N):
        c.append(C[i][j])
        if S[i][j]=="#":
            black+=1

for i in range(N*2):
    for j in range(N):
        sym.append((C[i][j]+C[i][2*N-j-1]))
c.sort(reverse=True)
sym.sort(reverse=True)
ans=sum(c[:black])

if black%2==1:
    print(ans)
    exit()

ans=max(ans,sum(sym[:black//2])+K)
print(ans)

0