結果

問題 No.2094 Symmetry
ユーザー lloyzlloyz
提出日時 2022-10-07 22:28:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 118,928 KB
最終ジャッジ日時 2023-09-03 13:39:20
合計ジャッジ時間 8,573 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,380 KB
testcase_01 AC 70 ms
70,980 KB
testcase_02 AC 69 ms
71,076 KB
testcase_03 AC 69 ms
71,240 KB
testcase_04 AC 69 ms
70,972 KB
testcase_05 AC 70 ms
71,104 KB
testcase_06 AC 69 ms
70,892 KB
testcase_07 AC 71 ms
71,368 KB
testcase_08 AC 72 ms
71,212 KB
testcase_09 AC 222 ms
118,076 KB
testcase_10 AC 223 ms
117,948 KB
testcase_11 AC 221 ms
118,632 KB
testcase_12 AC 220 ms
118,244 KB
testcase_13 AC 189 ms
109,060 KB
testcase_14 AC 223 ms
118,696 KB
testcase_15 AC 221 ms
118,516 KB
testcase_16 AC 218 ms
118,300 KB
testcase_17 AC 186 ms
108,992 KB
testcase_18 AC 191 ms
108,344 KB
testcase_19 AC 223 ms
118,684 KB
testcase_20 AC 219 ms
118,328 KB
testcase_21 AC 218 ms
118,928 KB
testcase_22 AC 218 ms
117,724 KB
testcase_23 AC 190 ms
109,008 KB
testcase_24 AC 188 ms
109,328 KB
testcase_25 AC 219 ms
118,532 KB
testcase_26 AC 218 ms
117,960 KB
testcase_27 AC 71 ms
71,364 KB
testcase_28 AC 135 ms
105,644 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 148 ms
116,828 KB
testcase_32 AC 149 ms
117,116 KB
testcase_33 AC 72 ms
70,932 KB
testcase_34 AC 151 ms
116,604 KB
testcase_35 AC 150 ms
109,424 KB
testcase_36 AC 138 ms
108,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

num = 0
L = []
for i in range(2 * n):
    for j in range(2 * n):
        L.append(C[i][j])
        if S[i][j] == '#':
            num += 1
L.sort(reverse=True)
ans = sum(L[:num])
if num > 0 and num % 2 == 0:
    LL = []
    for i in range(2 * n):
        for j in range(n):
            LL.append(C[i][j] + C[i][2 * n - j - 1])
    LL.sort(reverse=True)
    ans = max(ans, sum(LL[:num // 2]) + k)
print(ans)
0