結果

問題 No.2094 Symmetry
ユーザー qibqib
提出日時 2023-04-29 02:06:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 490 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 108,756 KB
最終ジャッジ日時 2024-04-29 02:11:23
合計ジャッジ時間 6,871 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,992 KB
testcase_01 AC 30 ms
52,796 KB
testcase_02 AC 34 ms
52,484 KB
testcase_03 AC 31 ms
52,332 KB
testcase_04 AC 32 ms
53,036 KB
testcase_05 AC 34 ms
53,444 KB
testcase_06 AC 30 ms
52,812 KB
testcase_07 AC 31 ms
52,752 KB
testcase_08 AC 31 ms
52,356 KB
testcase_09 AC 163 ms
108,064 KB
testcase_10 AC 164 ms
107,952 KB
testcase_11 AC 164 ms
108,756 KB
testcase_12 AC 162 ms
108,500 KB
testcase_13 AC 136 ms
99,072 KB
testcase_14 AC 177 ms
108,424 KB
testcase_15 AC 168 ms
108,228 KB
testcase_16 AC 169 ms
108,036 KB
testcase_17 AC 135 ms
98,900 KB
testcase_18 AC 136 ms
98,780 KB
testcase_19 AC 170 ms
108,504 KB
testcase_20 AC 166 ms
108,416 KB
testcase_21 AC 166 ms
108,628 KB
testcase_22 AC 160 ms
107,600 KB
testcase_23 AC 137 ms
99,152 KB
testcase_24 AC 136 ms
99,352 KB
testcase_25 AC 167 ms
108,172 KB
testcase_26 AC 165 ms
108,204 KB
testcase_27 AC 31 ms
52,076 KB
testcase_28 WA -
testcase_29 AC 33 ms
52,856 KB
testcase_30 WA -
testcase_31 AC 104 ms
107,148 KB
testcase_32 AC 109 ms
107,120 KB
testcase_33 AC 33 ms
53,244 KB
testcase_34 AC 103 ms
105,504 KB
testcase_35 AC 108 ms
105,576 KB
testcase_36 AC 92 ms
98,584 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])

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