結果

問題 No.2094 Symmetry
ユーザー tnogamitnogami
提出日時 2022-10-08 14:39:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 915 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 27,776 KB
最終ジャッジ日時 2023-09-04 20:04:52
合計ジャッジ時間 10,441 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,772 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 15 ms
7,860 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 15 ms
7,920 KB
testcase_05 AC 15 ms
7,852 KB
testcase_06 AC 15 ms
7,788 KB
testcase_07 AC 16 ms
7,800 KB
testcase_08 AC 15 ms
7,804 KB
testcase_09 AC 323 ms
26,476 KB
testcase_10 AC 319 ms
26,640 KB
testcase_11 AC 341 ms
27,408 KB
testcase_12 AC 326 ms
26,692 KB
testcase_13 AC 317 ms
27,128 KB
testcase_14 AC 326 ms
27,056 KB
testcase_15 AC 336 ms
27,108 KB
testcase_16 AC 319 ms
27,140 KB
testcase_17 AC 322 ms
27,064 KB
testcase_18 AC 323 ms
26,512 KB
testcase_19 AC 331 ms
27,104 KB
testcase_20 AC 329 ms
27,140 KB
testcase_21 AC 327 ms
27,108 KB
testcase_22 AC 319 ms
26,560 KB
testcase_23 AC 328 ms
27,036 KB
testcase_24 AC 329 ms
27,120 KB
testcase_25 AC 325 ms
27,076 KB
testcase_26 AC 324 ms
27,120 KB
testcase_27 AC 16 ms
7,908 KB
testcase_28 WA -
testcase_29 AC 15 ms
7,940 KB
testcase_30 WA -
testcase_31 AC 220 ms
27,604 KB
testcase_32 AC 218 ms
27,448 KB
testcase_33 AC 16 ms
7,860 KB
testcase_34 AC 196 ms
22,960 KB
testcase_35 AC 198 ms
22,872 KB
testcase_36 AC 221 ms
26,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
S = [input() for _ in range(2*N)]
C = [list(map(int, input().split())) for _ in range(2*N)]
C_1dim = []
symetry_point = []

black_ct = 0
for i in range(2*N):
    for j in range(2*N):
        if S[i][j] == "#":
            black_ct += 1
        C_1dim.append(C[i][j])

    for k in range(N):
        symetry_point.append(C[i][k]+C[i][-(k+1)])

C_1dim.sort()
symetry_point.sort()

ans = sum(C_1dim[-black_ct:])
if black_ct%2 == 1:
    print(ans)
else:
    print(max(ans, sum(symetry_point[-(black_ct//2):])+K)) 
0