結果

問題 No.2261 Coffee
ユーザー 👑 KazunKazun
提出日時 2023-04-07 23:37:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 554 ms / 2,000 ms
コード長 702 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 128,836 KB
最終ジャッジ日時 2024-04-10 18:17:11
合計ジャッジ時間 14,618 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,096 KB
testcase_01 AC 34 ms
52,480 KB
testcase_02 AC 32 ms
52,320 KB
testcase_03 AC 33 ms
52,352 KB
testcase_04 AC 33 ms
52,736 KB
testcase_05 AC 37 ms
59,520 KB
testcase_06 AC 40 ms
60,416 KB
testcase_07 AC 34 ms
52,608 KB
testcase_08 AC 38 ms
60,460 KB
testcase_09 AC 36 ms
59,136 KB
testcase_10 AC 51 ms
66,048 KB
testcase_11 AC 52 ms
66,560 KB
testcase_12 AC 45 ms
63,872 KB
testcase_13 AC 46 ms
64,512 KB
testcase_14 AC 47 ms
66,304 KB
testcase_15 AC 44 ms
63,360 KB
testcase_16 AC 48 ms
65,024 KB
testcase_17 AC 80 ms
77,904 KB
testcase_18 AC 84 ms
77,832 KB
testcase_19 AC 85 ms
78,080 KB
testcase_20 AC 83 ms
77,952 KB
testcase_21 AC 84 ms
78,336 KB
testcase_22 AC 79 ms
77,816 KB
testcase_23 AC 82 ms
78,208 KB
testcase_24 AC 494 ms
125,184 KB
testcase_25 AC 431 ms
117,888 KB
testcase_26 AC 511 ms
128,396 KB
testcase_27 AC 478 ms
124,260 KB
testcase_28 AC 409 ms
116,632 KB
testcase_29 AC 410 ms
116,352 KB
testcase_30 AC 331 ms
107,804 KB
testcase_31 AC 483 ms
124,672 KB
testcase_32 AC 487 ms
125,056 KB
testcase_33 AC 490 ms
124,800 KB
testcase_34 AC 518 ms
124,520 KB
testcase_35 AC 475 ms
125,056 KB
testcase_36 AC 478 ms
124,500 KB
testcase_37 AC 492 ms
124,544 KB
testcase_38 AC 515 ms
128,128 KB
testcase_39 AC 523 ms
128,836 KB
testcase_40 AC 542 ms
128,512 KB
testcase_41 AC 554 ms
128,256 KB
testcase_42 AC 551 ms
128,256 KB
testcase_43 AC 520 ms
128,384 KB
testcase_44 AC 517 ms
128,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def bit(S,k):
    return (S>>k)&1

def solve():
    N=int(input())
    F=[None]*N
    for i in range(N):
        F[i]=list(map(int,input().split()))


    K=5
    inf=float("inf")

    T=[[0]*(1<<K) for _ in range(N)]
    U=[inf]*(1<<K)
    for i in range(N):
        Ti=T[i]; Fi=F[i]
        for S in range(1<<K):
            for j in range(K):
                Ti[S]+=(1 if bit(S,j) else -1)*Fi[j]
            U[S]=min(U[S], Ti[S])

    Ans=[0]*N
    for i in range(N):
        Ti=T[i]
        Ans[i]=max(Ti[S]-U[S] for S in range(1<<K))
    return Ans

#==================================================
import sys
input=sys.stdin.readline
write=sys.stdout.write

write("\n".join(map(str,solve())))
0