結果

問題 No.2094 Symmetry
ユーザー june19312june19312
提出日時 2022-10-07 22:49:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 85,972 KB
実行使用メモリ 93,188 KB
最終ジャッジ日時 2023-09-03 14:30:40
合計ジャッジ時間 8,134 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,972 KB
testcase_01 AC 74 ms
70,992 KB
testcase_02 AC 72 ms
70,844 KB
testcase_03 AC 74 ms
70,684 KB
testcase_04 AC 73 ms
70,944 KB
testcase_05 AC 73 ms
70,688 KB
testcase_06 AC 73 ms
71,000 KB
testcase_07 AC 72 ms
71,128 KB
testcase_08 AC 73 ms
70,840 KB
testcase_09 AC 209 ms
90,436 KB
testcase_10 AC 210 ms
89,936 KB
testcase_11 AC 211 ms
89,812 KB
testcase_12 AC 209 ms
90,084 KB
testcase_13 AC 211 ms
90,252 KB
testcase_14 AC 212 ms
89,972 KB
testcase_15 AC 213 ms
90,040 KB
testcase_16 AC 217 ms
89,872 KB
testcase_17 AC 211 ms
89,872 KB
testcase_18 AC 210 ms
90,248 KB
testcase_19 AC 211 ms
90,068 KB
testcase_20 AC 214 ms
89,788 KB
testcase_21 AC 212 ms
90,076 KB
testcase_22 AC 212 ms
89,976 KB
testcase_23 AC 211 ms
89,896 KB
testcase_24 AC 209 ms
90,224 KB
testcase_25 AC 209 ms
90,048 KB
testcase_26 AC 209 ms
89,840 KB
testcase_27 AC 72 ms
70,972 KB
testcase_28 AC 145 ms
89,812 KB
testcase_29 AC 74 ms
70,872 KB
testcase_30 AC 145 ms
90,992 KB
testcase_31 AC 147 ms
90,184 KB
testcase_32 AC 149 ms
90,296 KB
testcase_33 AC 71 ms
70,752 KB
testcase_34 AC 146 ms
91,412 KB
testcase_35 AC 144 ms
92,124 KB
testcase_36 AC 150 ms
93,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())

kuro = 0
for i in range(N*2):
    tmp = input()
    kuro+=tmp.count("#")

score = []
score2 = []

for i in range(N*2):
    tmp2 = list(map(int,input().split()))
    for j in range(N):
        score2.append(tmp2[j]+tmp2[-1-j])
        score.append(tmp2[j])
        score.append(tmp2[-1-j])

score2.sort()
score2.reverse()
score.sort()
score.reverse()

if kuro%2 == 1:
    ans = sum(score[:kuro])
else:
    tmpans1 = sum(score[:kuro])
    tmpans2 = sum(score2[:(kuro//2)])+K
    ans = max(tmpans1,tmpans2)

print(ans)
0