結果

問題 No.2094 Symmetry
ユーザー ytftytft
提出日時 2022-10-22 07:29:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 508 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 245 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 102,520 KB
最終ジャッジ日時 2023-09-14 04:33:25
合計ジャッジ時間 15,540 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,256 KB
testcase_01 AC 59 ms
71,472 KB
testcase_02 AC 60 ms
71,408 KB
testcase_03 AC 62 ms
71,456 KB
testcase_04 AC 61 ms
71,432 KB
testcase_05 AC 62 ms
71,492 KB
testcase_06 AC 62 ms
71,292 KB
testcase_07 AC 64 ms
71,096 KB
testcase_08 AC 61 ms
71,524 KB
testcase_09 AC 473 ms
96,056 KB
testcase_10 AC 466 ms
96,420 KB
testcase_11 AC 468 ms
96,176 KB
testcase_12 AC 485 ms
96,244 KB
testcase_13 AC 463 ms
95,956 KB
testcase_14 AC 481 ms
95,776 KB
testcase_15 AC 480 ms
95,828 KB
testcase_16 AC 479 ms
95,756 KB
testcase_17 AC 460 ms
95,820 KB
testcase_18 AC 466 ms
96,316 KB
testcase_19 AC 472 ms
95,900 KB
testcase_20 AC 465 ms
96,320 KB
testcase_21 AC 479 ms
95,568 KB
testcase_22 AC 479 ms
96,520 KB
testcase_23 AC 485 ms
96,448 KB
testcase_24 AC 486 ms
96,560 KB
testcase_25 AC 508 ms
96,628 KB
testcase_26 AC 475 ms
96,040 KB
testcase_27 AC 66 ms
71,432 KB
testcase_28 AC 132 ms
89,420 KB
testcase_29 AC 63 ms
71,148 KB
testcase_30 AC 135 ms
89,024 KB
testcase_31 AC 142 ms
92,404 KB
testcase_32 AC 145 ms
92,044 KB
testcase_33 AC 68 ms
71,096 KB
testcase_34 AC 153 ms
93,880 KB
testcase_35 AC 212 ms
99,500 KB
testcase_36 AC 231 ms
102,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
N,K=map(int,input().split())
black=0
A=[0 for i in range(4*N**2)]
B=[0 for i in range(2*N**2)]
for i in range(2*N):
	black+=input().count('#')
for i in range(2*N):
	temp=list(map(int,input().split()))
	for j in range(2*N):
		A[i*2*N+j]=temp[j]
	for j in range(N):
		B[i*N+j]=temp[j]+temp[2*N-1-j]
A=sorted(A,key=lambda x:-x)
B=sorted(B,key=lambda x:-x)
ans=sum(A[:black])
if black%2==0:
	ans=max(ans,sum(B[:black//2])+K)
print(ans)
0