結果

問題 No.2094 Symmetry
ユーザー qibqib
提出日時 2023-04-29 02:10:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 108,644 KB
最終ジャッジ日時 2024-04-29 02:14:59
合計ジャッジ時間 6,424 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,712 KB
testcase_01 AC 40 ms
51,996 KB
testcase_02 AC 38 ms
52,224 KB
testcase_03 AC 37 ms
52,096 KB
testcase_04 AC 38 ms
52,096 KB
testcase_05 AC 38 ms
52,352 KB
testcase_06 AC 37 ms
52,224 KB
testcase_07 AC 38 ms
52,224 KB
testcase_08 AC 38 ms
51,968 KB
testcase_09 AC 195 ms
107,904 KB
testcase_10 AC 188 ms
107,808 KB
testcase_11 AC 189 ms
108,500 KB
testcase_12 AC 190 ms
108,544 KB
testcase_13 AC 160 ms
98,992 KB
testcase_14 AC 188 ms
108,252 KB
testcase_15 AC 189 ms
108,192 KB
testcase_16 AC 187 ms
107,676 KB
testcase_17 AC 157 ms
98,568 KB
testcase_18 AC 158 ms
98,760 KB
testcase_19 AC 187 ms
108,180 KB
testcase_20 AC 194 ms
108,564 KB
testcase_21 AC 188 ms
108,644 KB
testcase_22 AC 188 ms
107,776 KB
testcase_23 AC 157 ms
99,176 KB
testcase_24 AC 157 ms
99,036 KB
testcase_25 AC 190 ms
108,288 KB
testcase_26 AC 187 ms
108,296 KB
testcase_27 AC 38 ms
52,096 KB
testcase_28 AC 104 ms
95,856 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 120 ms
106,436 KB
testcase_32 AC 121 ms
106,880 KB
testcase_33 AC 38 ms
52,096 KB
testcase_34 AC 118 ms
105,436 KB
testcase_35 AC 119 ms
105,584 KB
testcase_36 AC 107 ms
98,396 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)]

cnt = 0
xs = []
for x in range(2 * n):
  for y in range(2 * n):
    if s[x][y] == "#":
      cnt += 1
    xs.append(c[x][y])

if cnt == 0:
  print("0")
  exit()

xs.sort()
ans = sum(xs[- cnt:])

if cnt % 2 != 0:
  print(ans)
  exit()

xs = []
for x in range(2 * n):
  for y in range(n):
    xs.append(c[x][y] + c[x][2 * n - 1 - y])

xs.sort()
ans = max(ans, sum(xs[- (cnt // 2):]) + k)
print(ans)
0