結果

問題 No.2094 Symmetry
ユーザー Akijin_007Akijin_007
提出日時 2022-10-07 22:33:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 223 ms / 2,000 ms
コード長 620 bytes
コンパイル時間 1,330 ms
コンパイル使用メモリ 86,540 KB
実行使用メモリ 112,360 KB
最終ジャッジ日時 2023-09-03 13:50:06
合計ジャッジ時間 8,298 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,952 KB
testcase_01 AC 74 ms
70,952 KB
testcase_02 AC 73 ms
71,148 KB
testcase_03 AC 73 ms
70,932 KB
testcase_04 AC 73 ms
70,940 KB
testcase_05 AC 74 ms
70,892 KB
testcase_06 AC 73 ms
70,932 KB
testcase_07 AC 74 ms
70,932 KB
testcase_08 AC 74 ms
70,744 KB
testcase_09 AC 222 ms
111,340 KB
testcase_10 AC 217 ms
111,260 KB
testcase_11 AC 223 ms
112,360 KB
testcase_12 AC 222 ms
111,732 KB
testcase_13 AC 191 ms
101,328 KB
testcase_14 AC 219 ms
111,824 KB
testcase_15 AC 219 ms
111,632 KB
testcase_16 AC 217 ms
111,268 KB
testcase_17 AC 185 ms
101,520 KB
testcase_18 AC 185 ms
101,100 KB
testcase_19 AC 217 ms
112,140 KB
testcase_20 AC 216 ms
111,648 KB
testcase_21 AC 218 ms
111,976 KB
testcase_22 AC 214 ms
110,860 KB
testcase_23 AC 187 ms
101,584 KB
testcase_24 AC 190 ms
101,268 KB
testcase_25 AC 218 ms
111,876 KB
testcase_26 AC 220 ms
111,616 KB
testcase_27 AC 71 ms
71,148 KB
testcase_28 AC 145 ms
107,696 KB
testcase_29 AC 71 ms
71,172 KB
testcase_30 AC 149 ms
107,176 KB
testcase_31 AC 156 ms
110,640 KB
testcase_32 AC 157 ms
110,320 KB
testcase_33 AC 75 ms
71,144 KB
testcase_34 AC 144 ms
103,360 KB
testcase_35 AC 147 ms
109,164 KB
testcase_36 AC 139 ms
100,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

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

a = 0
for i in range(M):
    a += S[i].count("#")

u = []
for i in range(M):
    for j in range(M):
        u.append(C[i][j])

u = sorted(u, reverse=True)
ans = sum(u[:a])

if a % 2 == 0:
    v = []
    for i in range(M):
        for j in range(N):
            v.append(C[i][j] + C[i][M-1-j])

    v = sorted(v, reverse=True)
    ans = max(ans, K + sum(v[:a//2]))

print(ans)

0