結果

問題 No.2261 Coffee
ユーザー ああいいああいい
提出日時 2023-04-08 18:31:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 805 ms / 2,000 ms
コード長 739 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,548 KB
実行使用メモリ 94,068 KB
最終ジャッジ日時 2024-04-14 15:19:11
合計ジャッジ時間 19,750 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,184 KB
testcase_01 AC 38 ms
53,632 KB
testcase_02 AC 37 ms
52,480 KB
testcase_03 AC 37 ms
52,764 KB
testcase_04 AC 36 ms
52,900 KB
testcase_05 AC 43 ms
61,428 KB
testcase_06 AC 48 ms
61,432 KB
testcase_07 AC 38 ms
52,668 KB
testcase_08 AC 48 ms
62,144 KB
testcase_09 AC 45 ms
60,344 KB
testcase_10 AC 56 ms
65,356 KB
testcase_11 AC 58 ms
66,588 KB
testcase_12 AC 56 ms
65,984 KB
testcase_13 AC 52 ms
65,008 KB
testcase_14 AC 55 ms
66,160 KB
testcase_15 AC 51 ms
64,160 KB
testcase_16 AC 53 ms
64,368 KB
testcase_17 AC 109 ms
77,168 KB
testcase_18 AC 110 ms
77,028 KB
testcase_19 AC 105 ms
76,888 KB
testcase_20 AC 102 ms
77,312 KB
testcase_21 AC 109 ms
76,968 KB
testcase_22 AC 103 ms
76,912 KB
testcase_23 AC 113 ms
77,364 KB
testcase_24 AC 706 ms
93,168 KB
testcase_25 AC 602 ms
89,848 KB
testcase_26 AC 801 ms
94,064 KB
testcase_27 AC 722 ms
92,656 KB
testcase_28 AC 606 ms
90,836 KB
testcase_29 AC 593 ms
90,716 KB
testcase_30 AC 482 ms
87,200 KB
testcase_31 AC 708 ms
92,972 KB
testcase_32 AC 706 ms
92,976 KB
testcase_33 AC 707 ms
93,040 KB
testcase_34 AC 702 ms
93,036 KB
testcase_35 AC 734 ms
93,180 KB
testcase_36 AC 707 ms
93,060 KB
testcase_37 AC 704 ms
93,180 KB
testcase_38 AC 755 ms
93,652 KB
testcase_39 AC 805 ms
93,780 KB
testcase_40 AC 765 ms
93,912 KB
testcase_41 AC 756 ms
93,656 KB
testcase_42 AC 750 ms
94,068 KB
testcase_43 AC 744 ms
93,940 KB
testcase_44 AC 751 ms
93,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

l = []
for _ in range(N):
    s = list(map(int,input().split()))
    l.append(s)

M = [-10 ** 16] * 32
m = [10 ** 16] * 32

for s in l:
    for bit in range(32):
        tmp = 0
        for i in range(5):
            if bit >> i & 1:
                tmp += s[i]
            else:
                tmp -= s[i]
        if tmp > M[bit]:M[bit] = tmp
        if tmp < m[bit]:m[bit] = tmp

for s in l:
    ans = 0
    for bit in range(32):
        tmp = 0
        for i in range(5):
            if bit >> i & 1:
                tmp += s[i]
            else:
                tmp -= s[i]
        t = abs(M[bit] - tmp)
        if t > ans:ans = t
        t = abs(m[bit] - tmp)
        if t > ans:
            ans = t
    print(ans)
0