結果

問題 No.2094 Symmetry
ユーザー SidewaysOwlSidewaysOwl
提出日時 2022-10-07 21:44:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 121,760 KB
最終ジャッジ日時 2023-09-03 01:10:54
合計ジャッジ時間 8,831 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,088 KB
testcase_01 AC 72 ms
71,264 KB
testcase_02 AC 72 ms
71,092 KB
testcase_03 AC 70 ms
71,340 KB
testcase_04 AC 74 ms
71,264 KB
testcase_05 WA -
testcase_06 AC 70 ms
71,260 KB
testcase_07 AC 73 ms
71,092 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 206 ms
111,524 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 206 ms
111,560 KB
testcase_18 AC 205 ms
111,184 KB
testcase_19 AC 232 ms
113,544 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 231 ms
112,664 KB
testcase_23 AC 200 ms
111,624 KB
testcase_24 AC 201 ms
111,840 KB
testcase_25 WA -
testcase_26 AC 233 ms
112,996 KB
testcase_27 AC 72 ms
71,324 KB
testcase_28 AC 165 ms
110,392 KB
testcase_29 AC 72 ms
71,200 KB
testcase_30 AC 169 ms
118,768 KB
testcase_31 AC 172 ms
112,488 KB
testcase_32 AC 172 ms
121,760 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 153 ms
113,032 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][n-j])
    cc.sort(reverse = True)
    ans = max(ans,sum(cc[:b_cnt//2]) + k)
print(ans)
0