結果

問題 No.2261 Coffee
ユーザー mkawa2mkawa2
提出日時 2023-04-07 21:45:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 919 ms / 2,000 ms
コード長 1,036 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 123,604 KB
最終ジャッジ日時 2024-04-10 16:52:19
合計ジャッジ時間 22,264 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,120 KB
testcase_01 AC 37 ms
54,268 KB
testcase_02 AC 35 ms
53,504 KB
testcase_03 AC 35 ms
52,716 KB
testcase_04 AC 31 ms
52,872 KB
testcase_05 AC 34 ms
58,844 KB
testcase_06 AC 39 ms
62,356 KB
testcase_07 AC 32 ms
52,944 KB
testcase_08 AC 43 ms
60,768 KB
testcase_09 AC 36 ms
58,848 KB
testcase_10 AC 69 ms
76,316 KB
testcase_11 AC 77 ms
76,116 KB
testcase_12 AC 68 ms
73,916 KB
testcase_13 AC 66 ms
73,788 KB
testcase_14 AC 73 ms
76,244 KB
testcase_15 AC 67 ms
72,296 KB
testcase_16 AC 68 ms
74,540 KB
testcase_17 AC 111 ms
78,140 KB
testcase_18 AC 101 ms
78,608 KB
testcase_19 AC 99 ms
78,196 KB
testcase_20 AC 97 ms
77,956 KB
testcase_21 AC 104 ms
78,188 KB
testcase_22 AC 98 ms
78,476 KB
testcase_23 AC 105 ms
78,528 KB
testcase_24 AC 863 ms
119,816 KB
testcase_25 AC 722 ms
113,736 KB
testcase_26 AC 846 ms
122,952 KB
testcase_27 AC 810 ms
119,412 KB
testcase_28 AC 744 ms
115,480 KB
testcase_29 AC 687 ms
115,212 KB
testcase_30 AC 566 ms
106,856 KB
testcase_31 AC 847 ms
123,156 KB
testcase_32 AC 836 ms
123,188 KB
testcase_33 AC 840 ms
123,168 KB
testcase_34 AC 854 ms
123,188 KB
testcase_35 AC 863 ms
123,464 KB
testcase_36 AC 862 ms
123,540 KB
testcase_37 AC 862 ms
123,204 KB
testcase_38 AC 891 ms
123,604 KB
testcase_39 AC 879 ms
123,116 KB
testcase_40 AC 919 ms
123,160 KB
testcase_41 AC 900 ms
123,264 KB
testcase_42 AC 910 ms
123,224 KB
testcase_43 AC 903 ms
123,436 KB
testcase_44 AC 880 ms
123,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = (1 << 63)-1
# md = 10**9+7
md = 998244353

n=II()
ae=LLI(n)

xx=[[0]*32 for _ in range(n)]
mns=[inf]*32
mask=31
for i in range(n):
    for s in range(32):
        x=sum(a if s>>j&1 else -a for j,a in enumerate(ae[i]))
        xx[i][s]=x
        mns[s]=min(mns[s],x)

for i in range(n):
    ans=0
    for s,x in enumerate(xx[i]):
        ans=max(ans,x-mns[s])
    print(ans)
0