結果

問題 No.2261 Coffee
ユーザー ShirotsumeShirotsume
提出日時 2023-04-07 21:49:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 508 ms / 2,000 ms
コード長 775 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 124,452 KB
最終ジャッジ日時 2024-04-10 16:55:46
合計ジャッジ時間 14,238 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
54,700 KB
testcase_01 AC 36 ms
54,924 KB
testcase_02 AC 38 ms
54,708 KB
testcase_03 AC 39 ms
54,012 KB
testcase_04 AC 40 ms
54,684 KB
testcase_05 AC 44 ms
61,824 KB
testcase_06 AC 45 ms
61,560 KB
testcase_07 AC 40 ms
54,504 KB
testcase_08 AC 45 ms
61,736 KB
testcase_09 AC 40 ms
61,784 KB
testcase_10 AC 55 ms
67,276 KB
testcase_11 AC 51 ms
66,568 KB
testcase_12 AC 47 ms
64,976 KB
testcase_13 AC 46 ms
65,040 KB
testcase_14 AC 50 ms
66,672 KB
testcase_15 AC 47 ms
65,104 KB
testcase_16 AC 47 ms
66,180 KB
testcase_17 AC 93 ms
78,400 KB
testcase_18 AC 86 ms
78,232 KB
testcase_19 AC 84 ms
78,020 KB
testcase_20 AC 82 ms
78,344 KB
testcase_21 AC 84 ms
78,660 KB
testcase_22 AC 82 ms
78,384 KB
testcase_23 AC 85 ms
78,396 KB
testcase_24 AC 454 ms
120,920 KB
testcase_25 AC 419 ms
114,928 KB
testcase_26 AC 490 ms
123,988 KB
testcase_27 AC 463 ms
120,940 KB
testcase_28 AC 398 ms
116,612 KB
testcase_29 AC 395 ms
115,988 KB
testcase_30 AC 329 ms
107,160 KB
testcase_31 AC 493 ms
124,216 KB
testcase_32 AC 471 ms
124,208 KB
testcase_33 AC 465 ms
124,180 KB
testcase_34 AC 459 ms
124,236 KB
testcase_35 AC 480 ms
124,140 KB
testcase_36 AC 462 ms
124,452 KB
testcase_37 AC 474 ms
124,448 KB
testcase_38 AC 499 ms
124,332 KB
testcase_39 AC 483 ms
124,284 KB
testcase_40 AC 482 ms
124,160 KB
testcase_41 AC 481 ms
124,248 KB
testcase_42 AC 484 ms
124,232 KB
testcase_43 AC 498 ms
124,208 KB
testcase_44 AC 508 ms
124,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n = ii()

ABCDE = [li() for _ in range(n)]

sgn = [[0] * 32 for i in range(n)]

for i in range(n):
    a = ABCDE[i]
    for bit in range(32):
        for j in range(5):
            if 1 & (bit >> j):
                sgn[i][bit] -= a[j]
            else:
                sgn[i][bit] += a[j]
ans = [0] * n
sgnmaxi = [-inf] * 32

for i in range(n):
    for j in range(32):
        sgnmaxi[j] = max(sgnmaxi[j], sgn[i][j])

for i in range(n):
    for j in range(32):
        ans[i] = max(ans[i], sgn[i][j] + sgnmaxi[31 ^ j])
        
for v in ans:
    print(v)
0