結果

問題 No.2094 Symmetry
ユーザー ニックネームニックネーム
提出日時 2022-10-07 21:41:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 27,356 KB
最終ジャッジ日時 2023-09-03 01:00:10
合計ジャッジ時間 8,765 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,920 KB
testcase_01 AC 16 ms
8,004 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 16 ms
7,864 KB
testcase_04 AC 16 ms
7,788 KB
testcase_05 AC 16 ms
7,820 KB
testcase_06 AC 16 ms
7,868 KB
testcase_07 AC 15 ms
7,880 KB
testcase_08 AC 16 ms
7,852 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 239 ms
26,508 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 239 ms
26,484 KB
testcase_18 AC 240 ms
25,900 KB
testcase_19 AC 269 ms
25,764 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 270 ms
25,728 KB
testcase_23 AC 242 ms
26,400 KB
testcase_24 AC 250 ms
26,448 KB
testcase_25 WA -
testcase_26 AC 267 ms
25,836 KB
testcase_27 AC 15 ms
7,792 KB
testcase_28 WA -
testcase_29 AC 16 ms
7,788 KB
testcase_30 WA -
testcase_31 AC 183 ms
26,836 KB
testcase_32 AC 183 ms
26,908 KB
testcase_33 AC 15 ms
7,864 KB
testcase_34 AC 158 ms
21,904 KB
testcase_35 AC 165 ms
21,808 KB
testcase_36 AC 183 ms
25,844 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(a[i]+a[2*n-1-i])
ans = 0 if x%2 else sum(sorted(b)[-x//2:])+k
print(max(ans, sum(sorted(a)[-x:])))
0