結果

問題 No.2094 Symmetry
ユーザー ニックネームニックネーム
提出日時 2022-10-07 22:05:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 250 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 27,256 KB
最終ジャッジ日時 2023-09-03 12:41:50
合計ジャッジ時間 7,646 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,820 KB
testcase_01 AC 14 ms
7,928 KB
testcase_02 AC 13 ms
7,844 KB
testcase_03 AC 13 ms
7,776 KB
testcase_04 AC 13 ms
7,832 KB
testcase_05 AC 14 ms
7,960 KB
testcase_06 AC 14 ms
7,948 KB
testcase_07 AC 13 ms
7,932 KB
testcase_08 AC 14 ms
7,860 KB
testcase_09 AC 245 ms
25,752 KB
testcase_10 AC 245 ms
25,872 KB
testcase_11 AC 250 ms
27,256 KB
testcase_12 AC 239 ms
25,924 KB
testcase_13 AC 198 ms
26,436 KB
testcase_14 AC 241 ms
25,972 KB
testcase_15 AC 244 ms
27,032 KB
testcase_16 AC 239 ms
25,772 KB
testcase_17 AC 208 ms
26,460 KB
testcase_18 AC 204 ms
25,980 KB
testcase_19 AC 247 ms
25,864 KB
testcase_20 AC 244 ms
25,916 KB
testcase_21 AC 247 ms
25,864 KB
testcase_22 AC 244 ms
25,760 KB
testcase_23 AC 205 ms
26,536 KB
testcase_24 AC 197 ms
26,476 KB
testcase_25 AC 246 ms
25,828 KB
testcase_26 AC 247 ms
25,752 KB
testcase_27 AC 13 ms
7,788 KB
testcase_28 AC 153 ms
25,032 KB
testcase_29 AC 13 ms
7,828 KB
testcase_30 AC 135 ms
24,988 KB
testcase_31 AC 156 ms
26,772 KB
testcase_32 AC 156 ms
26,928 KB
testcase_33 AC 14 ms
7,820 KB
testcase_34 AC 133 ms
21,804 KB
testcase_35 AC 140 ms
21,904 KB
testcase_36 AC 149 ms
25,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
x = 0; a = []; b = []
for _ in range(2*n):
    for v in input():
        if v == "#": x += 1
for _ in range(2*n):
    c = list(map(int, input().split()))
    for v in c: a.append(v)
    for i in range(n): b.append(c[i]+c[-1-i])
ans = 0 if x%2 else sum(sorted(b)[2*n*n-x//2:])+k
print(max(ans, sum(sorted(a)[4*n*n-x:])))
0