結果

問題 No.2261 Coffee
ユーザー とりゐとりゐ
提出日時 2023-03-20 00:43:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 425 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 81,464 KB
実行使用メモリ 101,456 KB
最終ジャッジ日時 2023-10-18 17:57:23
合計ジャッジ時間 13,554 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,564 KB
testcase_01 AC 38 ms
53,564 KB
testcase_02 AC 38 ms
53,564 KB
testcase_03 AC 38 ms
53,564 KB
testcase_04 AC 37 ms
53,564 KB
testcase_05 AC 37 ms
53,564 KB
testcase_06 AC 38 ms
53,564 KB
testcase_07 AC 37 ms
53,564 KB
testcase_08 AC 38 ms
53,564 KB
testcase_09 AC 38 ms
53,564 KB
testcase_10 AC 53 ms
64,624 KB
testcase_11 AC 54 ms
64,624 KB
testcase_12 AC 54 ms
64,632 KB
testcase_13 AC 53 ms
64,624 KB
testcase_14 AC 54 ms
64,624 KB
testcase_15 AC 50 ms
62,532 KB
testcase_16 AC 52 ms
64,624 KB
testcase_17 AC 81 ms
76,748 KB
testcase_18 AC 84 ms
76,760 KB
testcase_19 AC 79 ms
76,672 KB
testcase_20 AC 77 ms
76,552 KB
testcase_21 AC 84 ms
76,784 KB
testcase_22 AC 79 ms
76,708 KB
testcase_23 AC 80 ms
76,772 KB
testcase_24 AC 406 ms
99,260 KB
testcase_25 AC 407 ms
96,140 KB
testcase_26 AC 409 ms
101,044 KB
testcase_27 AC 374 ms
99,140 KB
testcase_28 AC 329 ms
97,228 KB
testcase_29 AC 314 ms
96,684 KB
testcase_30 AC 262 ms
92,320 KB
testcase_31 AC 361 ms
101,052 KB
testcase_32 AC 361 ms
101,320 KB
testcase_33 AC 392 ms
101,184 KB
testcase_34 AC 376 ms
101,324 KB
testcase_35 AC 363 ms
101,324 KB
testcase_36 AC 363 ms
101,324 KB
testcase_37 AC 363 ms
101,060 KB
testcase_38 AC 404 ms
101,324 KB
testcase_39 AC 396 ms
101,324 KB
testcase_40 AC 409 ms
101,324 KB
testcase_41 AC 393 ms
101,324 KB
testcase_42 AC 425 ms
101,328 KB
testcase_43 AC 410 ms
101,328 KB
testcase_44 AC 398 ms
101,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
input=lambda :stdin.readline()[:-1]

import itertools
sgns=[i for i in itertools.product([-1,1],repeat=5) if i[0]==1]

n=int(input())
S=[[0]*16 for i in range(n)]
mx=[-10**18]*16
mn=[10**18]*16
for i in range(n):
  A=list(map(int,input().split()))
  for j in range(16):
    res=0
    for s,k in zip(sgns[j],A):
      res+=s*k
    S[i][j]=res
    mx[j]=max(mx[j],S[i][j])
    mn[j]=min(mn[j],S[i][j])

ans=[0]*n
for i in range(n):
  for j in range(16):
    ans[i]=max(ans[i],mx[j]-S[i][j],S[i][j]-mn[j])

print(*ans,sep='\n')
0