結果

問題 No.2261 Coffee
ユーザー titiatitia
提出日時 2023-04-07 22:22:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,154 ms / 2,000 ms
コード長 674 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 117,060 KB
最終ジャッジ日時 2024-04-10 17:23:45
合計ジャッジ時間 25,766 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,028 KB
testcase_01 AC 39 ms
60,420 KB
testcase_02 AC 33 ms
52,992 KB
testcase_03 AC 33 ms
53,604 KB
testcase_04 AC 38 ms
61,348 KB
testcase_05 AC 40 ms
61,540 KB
testcase_06 AC 41 ms
62,328 KB
testcase_07 AC 37 ms
60,996 KB
testcase_08 AC 44 ms
62,528 KB
testcase_09 AC 43 ms
61,860 KB
testcase_10 AC 48 ms
66,308 KB
testcase_11 AC 50 ms
67,144 KB
testcase_12 AC 50 ms
67,080 KB
testcase_13 AC 49 ms
65,952 KB
testcase_14 AC 50 ms
65,812 KB
testcase_15 AC 48 ms
65,872 KB
testcase_16 AC 48 ms
66,096 KB
testcase_17 AC 95 ms
77,824 KB
testcase_18 AC 96 ms
77,556 KB
testcase_19 AC 94 ms
77,708 KB
testcase_20 AC 86 ms
77,596 KB
testcase_21 AC 96 ms
77,764 KB
testcase_22 AC 90 ms
77,740 KB
testcase_23 AC 99 ms
77,888 KB
testcase_24 AC 1,067 ms
113,124 KB
testcase_25 AC 924 ms
107,584 KB
testcase_26 AC 1,154 ms
115,572 KB
testcase_27 AC 1,047 ms
112,720 KB
testcase_28 AC 932 ms
110,184 KB
testcase_29 AC 921 ms
109,600 KB
testcase_30 AC 731 ms
101,900 KB
testcase_31 AC 1,004 ms
116,568 KB
testcase_32 AC 1,001 ms
117,012 KB
testcase_33 AC 1,060 ms
116,636 KB
testcase_34 AC 1,032 ms
116,840 KB
testcase_35 AC 1,059 ms
117,060 KB
testcase_36 AC 1,043 ms
116,508 KB
testcase_37 AC 1,043 ms
116,888 KB
testcase_38 AC 1,054 ms
115,336 KB
testcase_39 AC 1,037 ms
115,460 KB
testcase_40 AC 1,034 ms
115,856 KB
testcase_41 AC 1,043 ms
115,508 KB
testcase_42 AC 1,077 ms
115,420 KB
testcase_43 AC 1,071 ms
115,796 KB
testcase_44 AC 1,063 ms
115,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=[list(map(int,input().split())) for i in range(N)]

LIST=[[0]*N for i in range(32)]

for i in range(N):
    for j in range(32):
        sc=0
        for k in range(5):
            if j & (1<<k) != 0:
                sc+=A[i][k]
            else:
                sc-=A[i][k]

        LIST[j][i]=sc

LIST2=[]
for i in range(32):
    k=LIST[i].index(max(LIST[i]))
    LIST2.append(k)

    k=LIST[i].index(min(LIST[i]))
    LIST2.append(k)


for i in range(N):
    ANS=0

    for j in LIST2:
        sc=0
        for k in range(5):
            sc+=abs(A[i][k]-A[j][k])
            ANS=max(ANS,sc)

    print(ANS)
        
0