結果

問題 No.2094 Symmetry
ユーザー kys
提出日時 2022-10-07 21:33:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 91,404 KB
最終ジャッジ日時 2024-06-12 06:22:59
合計ジャッジ時間 6,282 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 12
権限があれば一括ダウンロードができます

ソースコード

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