結果

問題 No.2261 Coffee
ユーザー flygonflygon
提出日時 2023-04-07 21:55:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 588 ms / 2,000 ms
コード長 742 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,588 KB
実行使用メモリ 118,440 KB
最終ジャッジ日時 2024-04-10 17:01:37
合計ジャッジ時間 15,110 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
55,412 KB
testcase_01 AC 41 ms
55,948 KB
testcase_02 AC 38 ms
54,632 KB
testcase_03 AC 38 ms
55,184 KB
testcase_04 AC 40 ms
55,124 KB
testcase_05 AC 43 ms
62,504 KB
testcase_06 AC 42 ms
63,068 KB
testcase_07 AC 37 ms
55,048 KB
testcase_08 AC 43 ms
63,212 KB
testcase_09 AC 42 ms
62,456 KB
testcase_10 AC 51 ms
67,000 KB
testcase_11 AC 51 ms
67,052 KB
testcase_12 AC 49 ms
66,608 KB
testcase_13 AC 48 ms
65,644 KB
testcase_14 AC 51 ms
66,616 KB
testcase_15 AC 51 ms
65,524 KB
testcase_16 AC 50 ms
66,884 KB
testcase_17 AC 83 ms
78,328 KB
testcase_18 AC 78 ms
77,984 KB
testcase_19 AC 82 ms
78,028 KB
testcase_20 AC 76 ms
78,028 KB
testcase_21 AC 84 ms
77,984 KB
testcase_22 AC 83 ms
78,396 KB
testcase_23 AC 85 ms
78,056 KB
testcase_24 AC 504 ms
115,604 KB
testcase_25 AC 428 ms
109,268 KB
testcase_26 AC 574 ms
117,944 KB
testcase_27 AC 533 ms
115,448 KB
testcase_28 AC 432 ms
111,264 KB
testcase_29 AC 420 ms
110,976 KB
testcase_30 AC 334 ms
102,564 KB
testcase_31 AC 494 ms
117,656 KB
testcase_32 AC 532 ms
117,832 KB
testcase_33 AC 533 ms
117,976 KB
testcase_34 AC 531 ms
117,864 KB
testcase_35 AC 576 ms
117,940 KB
testcase_36 AC 501 ms
117,968 KB
testcase_37 AC 495 ms
118,036 KB
testcase_38 AC 523 ms
117,976 KB
testcase_39 AC 588 ms
118,440 KB
testcase_40 AC 533 ms
117,792 KB
testcase_41 AC 529 ms
117,920 KB
testcase_42 AC 526 ms
118,372 KB
testcase_43 AC 518 ms
118,352 KB
testcase_44 AC 551 ms
118,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n = int(input())
par = []
d = defaultdict(lambda: -float("inf"))
for i in range(n):
    a = list(map(int,input().split()))
    l = []
    for bit in range(32):
        tmp = 0
        for j in range(5):
            if (bit >> j) & 1:
                tmp += a[j]
            else:
                tmp -= a[j]
        l.append(tmp)
        d[bit] = max(d[bit], tmp)
    par.append(l)

for i in range(n):
    ans = -float("inf")
    for j in range(32):
        ans = max(ans, d[31-j] + par[i][j])
    print(ans)
    




0