結果

問題 No.2094 Symmetry
ユーザー kyskys
提出日時 2022-10-07 21:33:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 1,267 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 93,616 KB
最終ジャッジ日時 2023-09-03 00:33:50
合計ジャッジ時間 8,024 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,516 KB
testcase_01 AC 72 ms
71,204 KB
testcase_02 AC 72 ms
71,364 KB
testcase_03 AC 73 ms
71,276 KB
testcase_04 AC 74 ms
71,228 KB
testcase_05 AC 72 ms
71,228 KB
testcase_06 AC 72 ms
71,176 KB
testcase_07 AC 72 ms
71,268 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 179 ms
89,892 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 178 ms
89,716 KB
testcase_18 AC 178 ms
89,732 KB
testcase_19 AC 201 ms
90,804 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 197 ms
89,964 KB
testcase_23 AC 180 ms
89,884 KB
testcase_24 AC 179 ms
89,872 KB
testcase_25 WA -
testcase_26 AC 201 ms
89,888 KB
testcase_27 AC 71 ms
71,312 KB
testcase_28 AC 132 ms
90,520 KB
testcase_29 AC 72 ms
71,392 KB
testcase_30 AC 135 ms
90,184 KB
testcase_31 AC 133 ms
90,580 KB
testcase_32 AC 136 ms
90,192 KB
testcase_33 AC 71 ms
71,388 KB
testcase_34 AC 131 ms
93,616 KB
testcase_35 WA -
testcase_36 AC 135 ms
93,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    from sys import stdin, setrecursionlimit
    # setrecursionlimit(1000000)
    input = stdin.readline
    def iinput(): return int(input())
    def sinput(): return input().rstrip()
    def i0input(): return int(input()) - 1
    def linput(): return list(input().split())
    def liinput(): return list(map(int, input().split()))
    def miinput(): return map(int, input().split())
    def li0input(): return list(map(lambda x: int(x) - 1, input().split()))
    def mi0input(): return map(lambda x: int(x) - 1, input().split())
    INF = 1000000000000000000
    MOD = 1000000007

    N, K = miinput()
    S = []
    ctr = 0
    for _ in [0] * (2*N):
        tmp = sinput()
        S.append(tmp)
        ctr += tmp.count('#')
    
    C = []
    D = []
    for _ in [0] * (2*N):
        c = liinput()
        for k in c:
            C.append(k)
        for k, l in zip(c[:N], c[N:]):
            D.append(k+l)
    
    C.sort(reverse=True)
    ans = sum(C[:ctr])
    if ctr % 2 == 0:
        D.sort(reverse=True)
        ans = max(ans, K + sum(D[:ctr//2]))
    
    print(ans)
    


main()
0