結果

問題 No.2094 Symmetry
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-10-07 22:19:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 108,564 KB
最終ジャッジ日時 2023-09-03 13:15:16
合計ジャッジ時間 8,362 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,200 KB
testcase_01 AC 70 ms
71,312 KB
testcase_02 AC 70 ms
71,156 KB
testcase_03 AC 70 ms
71,156 KB
testcase_04 AC 70 ms
71,288 KB
testcase_05 AC 70 ms
71,196 KB
testcase_06 AC 70 ms
71,320 KB
testcase_07 AC 71 ms
71,372 KB
testcase_08 AC 69 ms
71,460 KB
testcase_09 AC 214 ms
107,964 KB
testcase_10 AC 214 ms
108,152 KB
testcase_11 AC 216 ms
108,132 KB
testcase_12 AC 212 ms
108,120 KB
testcase_13 AC 181 ms
99,020 KB
testcase_14 AC 211 ms
107,948 KB
testcase_15 AC 209 ms
107,660 KB
testcase_16 AC 212 ms
108,244 KB
testcase_17 AC 183 ms
98,968 KB
testcase_18 AC 187 ms
98,748 KB
testcase_19 AC 216 ms
108,156 KB
testcase_20 AC 213 ms
108,236 KB
testcase_21 AC 211 ms
108,564 KB
testcase_22 AC 211 ms
107,624 KB
testcase_23 AC 183 ms
99,048 KB
testcase_24 AC 182 ms
99,144 KB
testcase_25 AC 211 ms
108,264 KB
testcase_26 AC 212 ms
108,032 KB
testcase_27 AC 75 ms
71,068 KB
testcase_28 AC 142 ms
105,032 KB
testcase_29 AC 72 ms
71,276 KB
testcase_30 AC 150 ms
104,948 KB
testcase_31 AC 152 ms
105,236 KB
testcase_32 AC 145 ms
105,180 KB
testcase_33 AC 68 ms
71,400 KB
testcase_34 AC 138 ms
100,920 KB
testcase_35 AC 142 ms
105,396 KB
testcase_36 AC 130 ms
97,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
S = [input() for i in range(2*n)]
C = [list(map(int,input().split())) for i in range(2*n)]

num = 0
for s in S:
    num += s.count("#")

ans = -10**20

sC = []
for c in C:
    for i in c:
        sC.append(i)
sC.sort(reverse=True)
count = 0
for i in range(num):
    count += sC[i]
ans = max(ans,count)

if num%2 == 0:
    sC = []
    for c in C:
        for i in range(n):
            cal = c[i]+c[-i-1]
            sC.append(cal)
    sC.sort(reverse=True)
    count = k
    for i in range(num//2):
        count += sC[i]
    ans = max(ans,count)
print(ans)
0