結果

問題 No.2261 Coffee
ユーザー 👑 timitimi
提出日時 2024-02-18 12:30:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 751 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 306,824 KB
最終ジャッジ日時 2024-02-18 12:30:36
合計ジャッジ時間 9,711 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 34 ms
53,460 KB
testcase_03 AC 32 ms
53,460 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#N,L,R=map(int, input().split())
#A=list(map(int, input().split()))
N=int(input())
C=[];D={}
for j in range(2**5):
  B=[];D[j]=[]
  for k in range(5):
    if j%2==1:
      B.append(1)
    else:
      B.append(-1)
    j//=2 
  C.append(B)

A=[]
for i in range(N):
  a,b,c,d,e=map(int, input().split())
  A.append((a,b,c,d,e))
  now=-1
  for x,y,z,w,v in C:
    now+=1
    c=abs(a*x)+abs(b*y)+abs(c*z)+abs(d*w)+abs(e*v)
    D[now].append((c,i))
for d in D:
  D[d]=sorted(D[d])


for a,b,c,d,e in A:
  ans=[]
  for i in range(32):
    x,y,z,w,v=A[D[i][0][1]] 
    cc=abs(a-x)+abs(b-y)+abs(c-z)+abs(d-w)+abs(e-v)
    ans.append(cc)
    x,y,z,w,v=A[D[i][-1][1]] 
    cc=abs(a-x)+abs(b-y)+abs(c-z)+abs(d-w)+abs(e-v)
    ans.append(cc)
  print(max(ans))
    
0