結果

問題 No.2094 Symmetry
ユーザー rlangevinrlangevin
提出日時 2023-01-10 23:02:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 107,744 KB
最終ジャッジ日時 2023-08-23 10:26:12
合計ジャッジ時間 10,798 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,272 KB
testcase_01 AC 69 ms
71,452 KB
testcase_02 AC 69 ms
71,200 KB
testcase_03 AC 68 ms
71,388 KB
testcase_04 AC 70 ms
71,456 KB
testcase_05 AC 68 ms
71,352 KB
testcase_06 AC 69 ms
71,268 KB
testcase_07 AC 69 ms
71,416 KB
testcase_08 AC 69 ms
71,364 KB
testcase_09 AC 222 ms
106,816 KB
testcase_10 AC 217 ms
106,764 KB
testcase_11 AC 218 ms
107,696 KB
testcase_12 AC 214 ms
107,460 KB
testcase_13 AC 186 ms
97,992 KB
testcase_14 AC 220 ms
107,152 KB
testcase_15 AC 218 ms
107,168 KB
testcase_16 AC 218 ms
107,132 KB
testcase_17 AC 185 ms
97,488 KB
testcase_18 AC 187 ms
97,036 KB
testcase_19 AC 218 ms
107,348 KB
testcase_20 AC 220 ms
107,320 KB
testcase_21 AC 219 ms
107,744 KB
testcase_22 AC 218 ms
106,588 KB
testcase_23 AC 185 ms
97,784 KB
testcase_24 AC 186 ms
97,696 KB
testcase_25 AC 217 ms
107,224 KB
testcase_26 AC 218 ms
107,064 KB
testcase_27 AC 70 ms
71,292 KB
testcase_28 AC 146 ms
102,952 KB
testcase_29 AC 70 ms
71,204 KB
testcase_30 AC 153 ms
102,852 KB
testcase_31 AC 150 ms
106,028 KB
testcase_32 AC 153 ms
105,788 KB
testcase_33 AC 71 ms
71,092 KB
testcase_34 AC 174 ms
103,924 KB
testcase_35 AC 187 ms
103,288 KB
testcase_36 AC 153 ms
99,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
S = []
cnt = 0
for i in range(2 * N):
    L = list(input())
    cnt += L.count("#")
    S.append(L)
C = []
V = []
for i in range(2 * N):
    L = list(map(int, input().split()))
    C.append(L)
    V.extend(L)
    
V.sort(reverse=True)
ans = sum(V[:cnt])
if cnt % 2:
    print(ans)
    exit()
P = []
for i in range(2 * N):
    for j in range(N):
        P.append(C[i][j] + C[i][2 * N - 1 - j])
P.sort(reverse=True)
print(max(ans, sum(P[:cnt//2]) + K))
0