結果

問題 No.2094 Symmetry
ユーザー 310icecrystal310icecrystal
提出日時 2023-05-11 03:23:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 94,024 KB
最終ジャッジ日時 2023-08-18 03:13:45
合計ジャッジ時間 8,356 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,268 KB
testcase_01 AC 73 ms
71,572 KB
testcase_02 AC 75 ms
71,260 KB
testcase_03 AC 72 ms
71,416 KB
testcase_04 AC 74 ms
71,440 KB
testcase_05 AC 72 ms
71,464 KB
testcase_06 AC 73 ms
71,292 KB
testcase_07 AC 74 ms
71,328 KB
testcase_08 AC 72 ms
71,200 KB
testcase_09 AC 206 ms
90,908 KB
testcase_10 AC 206 ms
91,544 KB
testcase_11 AC 207 ms
90,880 KB
testcase_12 AC 208 ms
90,560 KB
testcase_13 AC 205 ms
91,028 KB
testcase_14 AC 208 ms
91,056 KB
testcase_15 AC 207 ms
91,032 KB
testcase_16 AC 211 ms
90,760 KB
testcase_17 AC 210 ms
90,712 KB
testcase_18 AC 207 ms
91,004 KB
testcase_19 AC 210 ms
91,012 KB
testcase_20 AC 208 ms
90,916 KB
testcase_21 AC 209 ms
90,696 KB
testcase_22 AC 205 ms
91,128 KB
testcase_23 AC 204 ms
90,996 KB
testcase_24 AC 207 ms
90,972 KB
testcase_25 AC 210 ms
90,492 KB
testcase_26 AC 208 ms
91,060 KB
testcase_27 AC 73 ms
71,296 KB
testcase_28 AC 142 ms
90,624 KB
testcase_29 AC 71 ms
71,580 KB
testcase_30 AC 138 ms
91,500 KB
testcase_31 AC 144 ms
90,468 KB
testcase_32 AC 141 ms
91,508 KB
testcase_33 AC 74 ms
71,200 KB
testcase_34 AC 143 ms
92,108 KB
testcase_35 AC 141 ms
92,836 KB
testcase_36 AC 147 ms
94,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
black_count = 0
for _ in range(2*N):
    black_count += input().count("#")
li = []
li_sym = []
for i in range(2*N):
    C = list(map(int,input().split()))
    for j in range(N):
        a = C[j]
        b = C[-j-1]
        li.append(a)
        li.append(b)
        li_sym.append(a+b)

li.sort(reverse=True)
li_sym.sort(reverse=True)
ans = sum(li[:black_count])
if black_count % 2 == 0:
    k = black_count // 2
    ans = max(ans,sum(li_sym[:k])+K)
print(ans)
0