結果

問題 No.2094 Symmetry
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-10-07 21:53:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 238 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 965 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 121,536 KB
最終ジャッジ日時 2023-09-03 01:37:33
合計ジャッジ時間 9,024 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,500 KB
testcase_01 AC 72 ms
71,400 KB
testcase_02 AC 72 ms
71,344 KB
testcase_03 AC 72 ms
71,452 KB
testcase_04 AC 73 ms
71,404 KB
testcase_05 AC 72 ms
71,564 KB
testcase_06 AC 73 ms
71,404 KB
testcase_07 AC 72 ms
71,344 KB
testcase_08 AC 73 ms
71,436 KB
testcase_09 AC 236 ms
113,160 KB
testcase_10 AC 237 ms
112,772 KB
testcase_11 AC 236 ms
113,752 KB
testcase_12 AC 235 ms
113,364 KB
testcase_13 AC 203 ms
111,704 KB
testcase_14 AC 233 ms
113,528 KB
testcase_15 AC 234 ms
113,384 KB
testcase_16 AC 236 ms
113,512 KB
testcase_17 AC 201 ms
111,448 KB
testcase_18 AC 206 ms
111,564 KB
testcase_19 AC 237 ms
113,672 KB
testcase_20 AC 233 ms
113,368 KB
testcase_21 AC 233 ms
113,724 KB
testcase_22 AC 234 ms
112,856 KB
testcase_23 AC 200 ms
112,060 KB
testcase_24 AC 202 ms
111,912 KB
testcase_25 AC 236 ms
113,376 KB
testcase_26 AC 238 ms
113,296 KB
testcase_27 AC 70 ms
70,952 KB
testcase_28 AC 163 ms
110,508 KB
testcase_29 AC 70 ms
71,308 KB
testcase_30 AC 166 ms
118,820 KB
testcase_31 AC 169 ms
112,392 KB
testcase_32 AC 172 ms
121,536 KB
testcase_33 AC 70 ms
70,956 KB
testcase_34 AC 165 ms
119,832 KB
testcase_35 AC 167 ms
120,056 KB
testcase_36 AC 156 ms
113,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
s = [list(input()) for _ in range(2*n)]
c = [tuple(map(int,input().split())) for _ in range(2*n)]
b_cnt = sum(e.count("#") for e in s)
cc = []
for i in range(2*n):
    for j in c[i]:
        cc.append(j)
cc.sort(reverse = True)
ans = sum(cc[:b_cnt])
if not b_cnt & 1:
    cc = []
    for i in range(2*n):
        for j in range(n):
            cc.append(c[i][j] + c[i][2*n-j-1])
    cc.sort(reverse = True)
    ans = max(ans,sum(cc[:b_cnt//2]) + k)
print(ans)
0