結果

問題 No.2261 Coffee
ユーザー 👑 timitimi
提出日時 2024-02-18 15:35:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 926 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 303,848 KB
最終ジャッジ日時 2024-02-18 15:36:02
合計ジャッジ時間 12,983 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
60,264 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 42 ms
59,060 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 39 ms
59,060 KB
testcase_09 AC 36 ms
53,460 KB
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=a*x+b*y+c*z+d*w+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)
    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)
    x,y,z,w,v=A[D[i][-2][1]] 
    cc=abs(a-x)+abs(b-y)+abs(c-z)+abs(d-w)+abs(e-v)
    ans.append(cc)
  print(max(ans))
    
0