結果

問題 No.2094 Symmetry
ユーザー ああいいああいい
提出日時 2022-10-08 21:07:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 609 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 108,540 KB
最終ジャッジ日時 2023-09-05 02:38:28
合計ジャッジ時間 10,048 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,196 KB
testcase_01 AC 75 ms
71,324 KB
testcase_02 AC 77 ms
71,124 KB
testcase_03 AC 75 ms
71,332 KB
testcase_04 AC 75 ms
71,340 KB
testcase_05 AC 76 ms
71,128 KB
testcase_06 AC 78 ms
71,128 KB
testcase_07 AC 78 ms
71,380 KB
testcase_08 AC 76 ms
71,212 KB
testcase_09 AC 227 ms
101,024 KB
testcase_10 AC 224 ms
100,676 KB
testcase_11 AC 225 ms
101,788 KB
testcase_12 AC 225 ms
101,100 KB
testcase_13 AC 223 ms
100,944 KB
testcase_14 AC 222 ms
101,384 KB
testcase_15 AC 224 ms
101,324 KB
testcase_16 AC 221 ms
101,128 KB
testcase_17 AC 225 ms
100,820 KB
testcase_18 AC 222 ms
100,448 KB
testcase_19 AC 227 ms
101,260 KB
testcase_20 AC 229 ms
101,424 KB
testcase_21 AC 230 ms
101,864 KB
testcase_22 AC 225 ms
100,332 KB
testcase_23 AC 228 ms
101,032 KB
testcase_24 AC 228 ms
101,404 KB
testcase_25 AC 225 ms
101,296 KB
testcase_26 AC 229 ms
100,920 KB
testcase_27 AC 76 ms
71,304 KB
testcase_28 AC 156 ms
105,160 KB
testcase_29 AC 76 ms
71,392 KB
testcase_30 AC 157 ms
104,980 KB
testcase_31 AC 158 ms
108,004 KB
testcase_32 AC 155 ms
107,924 KB
testcase_33 AC 74 ms
71,120 KB
testcase_34 AC 155 ms
107,328 KB
testcase_35 AC 157 ms
107,372 KB
testcase_36 AC 155 ms
108,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
S = [input() for _ in range(N + N)]
C = [list(map(int,input().split())) for _ in range(N + N)]

black = 0
for s in S:
    for u in s:
        if u == "#":
            black += 1

l = []
for c in C:
    for u in c:
        l.append(u)
l.sort(reverse = True)
ans = sum(l[:black])
ans2 = K
ll = []
for i in range(N + N):
    for j in range(N):
        ll.append(C[i][j] + C[i][2 * N - 1 - j])
ll.sort(reverse = True)
if black % 2 == 0:
    ans2 += sum(ll[:black // 2])
    if ans2 > ans:
        ans = ans2
print(ans)
0