結果

問題 No.2094 Symmetry
ユーザー kept1994kept1994
提出日時 2022-11-03 18:05:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 609 bytes
コンパイル時間 891 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 93,672 KB
最終ジャッジ日時 2023-09-25 02:16:06
合計ジャッジ時間 10,775 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,352 KB
testcase_01 AC 69 ms
70,972 KB
testcase_02 AC 71 ms
71,344 KB
testcase_03 AC 69 ms
71,340 KB
testcase_04 AC 68 ms
71,372 KB
testcase_05 AC 68 ms
71,452 KB
testcase_06 AC 69 ms
71,416 KB
testcase_07 AC 69 ms
71,244 KB
testcase_08 AC 68 ms
71,348 KB
testcase_09 AC 235 ms
90,188 KB
testcase_10 AC 200 ms
90,368 KB
testcase_11 AC 199 ms
90,336 KB
testcase_12 AC 199 ms
90,236 KB
testcase_13 AC 198 ms
90,192 KB
testcase_14 AC 200 ms
90,156 KB
testcase_15 AC 203 ms
90,240 KB
testcase_16 AC 201 ms
90,332 KB
testcase_17 AC 202 ms
90,260 KB
testcase_18 AC 202 ms
90,148 KB
testcase_19 AC 203 ms
90,092 KB
testcase_20 AC 204 ms
90,228 KB
testcase_21 AC 201 ms
90,328 KB
testcase_22 AC 201 ms
90,224 KB
testcase_23 AC 202 ms
90,308 KB
testcase_24 AC 201 ms
90,236 KB
testcase_25 AC 199 ms
90,140 KB
testcase_26 AC 198 ms
90,188 KB
testcase_27 AC 66 ms
71,168 KB
testcase_28 AC 135 ms
90,212 KB
testcase_29 AC 73 ms
71,532 KB
testcase_30 AC 135 ms
89,764 KB
testcase_31 AC 139 ms
90,040 KB
testcase_32 AC 139 ms
89,868 KB
testcase_33 AC 69 ms
71,008 KB
testcase_34 AC 135 ms
93,672 KB
testcase_35 AC 140 ms
92,492 KB
testcase_36 AC 137 ms
93,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
def main():
    N, K = map(int, input().split())
    black = 0
    for _ in range(2 * N):
        ss = input()
        black += ss.count("#")
    all = []
    fold = []
    for _ in range(2 * N):
        l = list(map(int, input().split()))
        all.extend(l)
        for i in range(N):
            fold.append(l[i] + l[-(i + 1)])
    all.sort(reverse=True)
    fold.sort(reverse=True)
    notsyn = sum(all[:black])
    if black % 2 == 1:
        print(notsyn)
    else:
        syn = sum(fold[:(black // 2)])
        print(max(notsyn, syn + K))

if __name__ == '__main__':
    main()
0