結果

問題 No.2261 Coffee
ユーザー とりゐとりゐ
提出日時 2023-03-20 05:05:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 337 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 102,212 KB
最終ジャッジ日時 2023-10-18 18:01:19
合計ジャッジ時間 10,884 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,568 KB
testcase_01 AC 38 ms
53,568 KB
testcase_02 AC 38 ms
53,568 KB
testcase_03 AC 37 ms
53,568 KB
testcase_04 AC 37 ms
53,568 KB
testcase_05 AC 37 ms
53,568 KB
testcase_06 AC 39 ms
53,568 KB
testcase_07 AC 38 ms
53,568 KB
testcase_08 AC 38 ms
53,568 KB
testcase_09 AC 39 ms
53,568 KB
testcase_10 AC 52 ms
64,348 KB
testcase_11 AC 52 ms
64,348 KB
testcase_12 AC 48 ms
62,204 KB
testcase_13 AC 48 ms
62,204 KB
testcase_14 AC 51 ms
64,336 KB
testcase_15 AC 46 ms
62,184 KB
testcase_16 AC 48 ms
62,204 KB
testcase_17 AC 89 ms
76,656 KB
testcase_18 AC 92 ms
76,736 KB
testcase_19 AC 90 ms
76,648 KB
testcase_20 AC 90 ms
76,412 KB
testcase_21 AC 90 ms
76,740 KB
testcase_22 AC 91 ms
76,676 KB
testcase_23 AC 93 ms
76,760 KB
testcase_24 AC 306 ms
99,596 KB
testcase_25 AC 279 ms
95,628 KB
testcase_26 AC 329 ms
101,980 KB
testcase_27 AC 319 ms
99,020 KB
testcase_28 AC 250 ms
97,304 KB
testcase_29 AC 252 ms
96,524 KB
testcase_30 AC 212 ms
91,796 KB
testcase_31 AC 292 ms
100,808 KB
testcase_32 AC 291 ms
100,520 KB
testcase_33 AC 283 ms
100,780 KB
testcase_34 AC 287 ms
100,772 KB
testcase_35 AC 284 ms
100,740 KB
testcase_36 AC 305 ms
100,836 KB
testcase_37 AC 299 ms
100,632 KB
testcase_38 AC 320 ms
102,196 KB
testcase_39 AC 327 ms
102,200 KB
testcase_40 AC 330 ms
102,192 KB
testcase_41 AC 319 ms
102,200 KB
testcase_42 AC 337 ms
102,212 KB
testcase_43 AC 321 ms
102,188 KB
testcase_44 AC 325 ms
102,204 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())
a=[list(map(int,input().split())) for i in range(n)]
ans=[0]*n
for sgn in sgns:
  S=[0]*n
  for i in range(n):
    res=0
    for s,j in zip(sgn,a[i]):
      res+=s*j
    S[i]=res
  mx,mn=max(S),min(S)
  for i in range(n):
    ans[i]=max(ans[i],mx-S[i],S[i]-mn)

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