結果

問題 No.2261 Coffee
ユーザー Yakumo221Yakumo221
提出日時 2023-08-02 15:35:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 332 ms / 2,000 ms
コード長 869 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 113,080 KB
最終ジャッジ日時 2024-04-20 15:41:43
合計ジャッジ時間 12,391 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,152 KB
testcase_01 AC 37 ms
52,464 KB
testcase_02 AC 36 ms
52,992 KB
testcase_03 AC 36 ms
52,648 KB
testcase_04 AC 36 ms
52,476 KB
testcase_05 AC 36 ms
52,768 KB
testcase_06 AC 35 ms
52,736 KB
testcase_07 AC 34 ms
52,552 KB
testcase_08 AC 39 ms
53,552 KB
testcase_09 AC 34 ms
53,208 KB
testcase_10 AC 47 ms
62,452 KB
testcase_11 AC 47 ms
64,228 KB
testcase_12 AC 47 ms
62,276 KB
testcase_13 AC 44 ms
61,560 KB
testcase_14 AC 47 ms
62,936 KB
testcase_15 AC 44 ms
61,768 KB
testcase_16 AC 45 ms
62,436 KB
testcase_17 AC 72 ms
77,544 KB
testcase_18 AC 72 ms
77,820 KB
testcase_19 AC 66 ms
74,828 KB
testcase_20 AC 65 ms
74,660 KB
testcase_21 AC 73 ms
77,552 KB
testcase_22 AC 65 ms
74,064 KB
testcase_23 AC 75 ms
77,408 KB
testcase_24 AC 306 ms
110,248 KB
testcase_25 AC 269 ms
105,444 KB
testcase_26 AC 327 ms
112,228 KB
testcase_27 AC 303 ms
109,768 KB
testcase_28 AC 270 ms
106,804 KB
testcase_29 AC 249 ms
106,036 KB
testcase_30 AC 217 ms
99,408 KB
testcase_31 AC 300 ms
113,080 KB
testcase_32 AC 331 ms
112,636 KB
testcase_33 AC 287 ms
112,664 KB
testcase_34 AC 331 ms
112,576 KB
testcase_35 AC 297 ms
112,560 KB
testcase_36 AC 303 ms
112,732 KB
testcase_37 AC 280 ms
112,632 KB
testcase_38 AC 326 ms
112,776 KB
testcase_39 AC 320 ms
112,700 KB
testcase_40 AC 318 ms
112,760 KB
testcase_41 AC 331 ms
112,832 KB
testcase_42 AC 324 ms
112,704 KB
testcase_43 AC 321 ms
112,772 KB
testcase_44 AC 332 ms
112,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

n = int(input())

# mmlist[i] = [Max, min]
mmlist = [[0,0] for i in range(32)]
tastelist = [[] for i in range(n)]
signs = list(product([-1,1], repeat=5))
for i in range(n):
    a,b,c,d,e = map(int, input().split())

    for j in range(32):
        v,w,x,y,z = signs[j]
        rot = a*v + b*w + c*x + d*y + e*z
        if i == 0:
            mmlist[j][0] = rot
            mmlist[j][1] = rot
        else:
            if mmlist[j][0] < rot:
                mmlist[j][0] = rot
            if mmlist[j][1] > rot:
                mmlist[j][1] = rot
        tastelist[i].append(rot)
        

ans = 0

# print(tastelist)
# print(mmlist)

for i in range(n):
    ans = 0
    for j in range(32):
        dist = max(mmlist[j][0] - tastelist[i][j], mmlist[j][1] - tastelist[i][j])
        if ans < dist:
            ans = dist
    
    print(ans)
0