結果

問題 No.2094 Symmetry
ユーザー 👑 H20H20
提出日時 2022-10-07 22:41:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 231 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 107,328 KB
最終ジャッジ日時 2023-09-03 14:10:38
合計ジャッジ時間 8,917 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,116 KB
testcase_01 AC 70 ms
71,092 KB
testcase_02 AC 70 ms
71,020 KB
testcase_03 AC 70 ms
70,836 KB
testcase_04 AC 70 ms
71,084 KB
testcase_05 AC 71 ms
71,124 KB
testcase_06 AC 71 ms
71,084 KB
testcase_07 AC 70 ms
71,284 KB
testcase_08 AC 69 ms
71,092 KB
testcase_09 AC 231 ms
106,552 KB
testcase_10 AC 217 ms
106,148 KB
testcase_11 AC 217 ms
107,324 KB
testcase_12 AC 217 ms
107,048 KB
testcase_13 AC 188 ms
97,472 KB
testcase_14 AC 217 ms
106,924 KB
testcase_15 AC 218 ms
107,296 KB
testcase_16 AC 215 ms
106,764 KB
testcase_17 AC 185 ms
97,116 KB
testcase_18 AC 187 ms
96,852 KB
testcase_19 AC 219 ms
106,896 KB
testcase_20 AC 220 ms
106,864 KB
testcase_21 AC 222 ms
107,240 KB
testcase_22 AC 229 ms
106,096 KB
testcase_23 AC 190 ms
97,360 KB
testcase_24 AC 188 ms
97,356 KB
testcase_25 AC 222 ms
107,328 KB
testcase_26 AC 227 ms
106,532 KB
testcase_27 AC 75 ms
71,280 KB
testcase_28 AC 155 ms
102,624 KB
testcase_29 AC 70 ms
71,160 KB
testcase_30 AC 157 ms
102,592 KB
testcase_31 AC 151 ms
106,028 KB
testcase_32 AC 151 ms
105,712 KB
testcase_33 AC 70 ms
70,952 KB
testcase_34 AC 149 ms
103,916 KB
testcase_35 AC 148 ms
102,632 KB
testcase_36 AC 137 ms
98,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int, input().split())
S =  []
black = 0
for _ in range(N*2):
    S.append(list(input()))
    black+=S[-1].count('#')
C = []
ALL = []
for _ in range(N*2):
    C.append(list(map(int, input().split())))
    ALL.extend(C[-1])
ALL.sort(reverse=True)
ans = sum(ALL[:black])
if black%2==0:
    MIRROR = []
    for i in range(N*2):
        for j in range(N):
            MIRROR.append(C[i][j]+C[i][2*N-j-1])
    MIRROR.sort(reverse=True)
    ans = max(ans,sum(MIRROR[:black//2])+K)

print(ans)
0