結果
問題 | No.2094 Symmetry |
ユーザー |
![]() |
提出日時 | 2022-10-07 22:08:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 162 ms / 2,000 ms |
コード長 | 436 bytes |
コンパイル時間 | 447 ms |
コンパイル使用メモリ | 82,028 KB |
実行使用メモリ | 110,016 KB |
最終ジャッジ日時 | 2024-06-12 18:42:26 |
合計ジャッジ時間 | 6,024 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
ソースコード
n, k = map(int, input().split())cnt = sum(input().count('#') for _ in range(2 * n))c = [list(map(int, input().split())) for _ in range(2 * n)]c_all = []for ci in c:c_all += cians = sum(sorted(c_all, reverse=True)[:cnt])if cnt % 2 == 0:c_sym = []for ci in c:for j in range(n):c_sym.append(ci[j] + ci[2 * n - 1 - j])ans = max(ans, sum(sorted(c_sym, reverse=True)[:cnt // 2]) + k)print(ans)