結果

問題 No.2094 Symmetry
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-10-10 10:21:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 121,632 KB
最終ジャッジ日時 2023-09-06 11:16:45
合計ジャッジ時間 10,288 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
72,988 KB
testcase_01 AC 90 ms
72,836 KB
testcase_02 AC 89 ms
72,724 KB
testcase_03 AC 89 ms
72,848 KB
testcase_04 AC 89 ms
72,724 KB
testcase_05 AC 92 ms
73,024 KB
testcase_06 AC 91 ms
72,944 KB
testcase_07 AC 90 ms
72,740 KB
testcase_08 AC 87 ms
72,524 KB
testcase_09 AC 224 ms
120,808 KB
testcase_10 AC 232 ms
120,856 KB
testcase_11 AC 228 ms
121,616 KB
testcase_12 AC 226 ms
121,492 KB
testcase_13 AC 204 ms
112,112 KB
testcase_14 AC 229 ms
121,412 KB
testcase_15 AC 225 ms
121,172 KB
testcase_16 AC 226 ms
121,228 KB
testcase_17 AC 197 ms
111,892 KB
testcase_18 AC 196 ms
111,632 KB
testcase_19 AC 225 ms
121,632 KB
testcase_20 AC 224 ms
121,484 KB
testcase_21 AC 224 ms
121,560 KB
testcase_22 AC 231 ms
120,364 KB
testcase_23 AC 195 ms
112,180 KB
testcase_24 AC 194 ms
112,184 KB
testcase_25 AC 227 ms
121,400 KB
testcase_26 AC 225 ms
121,316 KB
testcase_27 AC 91 ms
72,516 KB
testcase_28 WA -
testcase_29 AC 87 ms
72,724 KB
testcase_30 WA -
testcase_31 AC 163 ms
120,008 KB
testcase_32 AC 165 ms
120,120 KB
testcase_33 AC 93 ms
72,928 KB
testcase_34 AC 159 ms
119,336 KB
testcase_35 AC 161 ms
119,928 KB
testcase_36 AC 150 ms
113,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from itertools import *
from functools import *
import math,sys
input = sys.stdin.readline

N,K = map(int,input().split())
S = [list(input())[:-1] for _ in range(2*N)]
C = [list(map(int,input().split())) for _ in range(2*N)]
X = 0
for i in range(2*N):
    S[i] = [int(j=='#') for j in S[i]]
    X += sum(S[i])
ans = 0
Y = []
for i in range(2*N):
    for j in range(2*N):
        Y.append(C[i][j])
Y.sort()
ans = sum(Y[-X:])

if X%2==1:
    print(ans)
    exit()

x = X//2
Y = []
for i in range(2*N):
    for j in range(N):
        Y.append(C[i][j]+C[i][-1-j])
Y.sort()
tmp = sum(Y[-x:])+K
print(max(ans,tmp))
0