結果

問題 No.2261 Coffee
ユーザー tamatotamato
提出日時 2023-04-07 21:32:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 102,796 KB
最終ジャッジ日時 2024-04-10 16:39:29
合計ジャッジ時間 34,921 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,352 KB
testcase_01 AC 38 ms
52,880 KB
testcase_02 AC 38 ms
52,736 KB
testcase_03 AC 37 ms
53,120 KB
testcase_04 AC 39 ms
52,992 KB
testcase_05 AC 43 ms
59,940 KB
testcase_06 AC 47 ms
61,696 KB
testcase_07 AC 39 ms
52,736 KB
testcase_08 AC 47 ms
61,824 KB
testcase_09 AC 44 ms
59,648 KB
testcase_10 AC 79 ms
76,024 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 68 ms
73,984 KB
testcase_14 AC 76 ms
76,232 KB
testcase_15 WA -
testcase_16 AC 73 ms
74,496 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 134 ms
77,312 KB
testcase_20 AC 122 ms
76,876 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 137 ms
77,824 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1,152 ms
98,856 KB
testcase_30 AC 980 ms
92,388 KB
testcase_31 WA -
testcase_32 AC 1,355 ms
102,464 KB
testcase_33 WA -
testcase_34 AC 1,514 ms
102,120 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 1,433 ms
102,212 KB
testcase_38 AC 1,429 ms
102,252 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 1,556 ms
102,248 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 1,544 ms
102,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
mod = 998244353

def dist(X, Y):
    return sum([abs(x - y) for x, y in zip(X, Y)])

N = int(input())
ABCDE = []
for _ in range(N):
    ABCDE.append(tuple(map(int, input().split())))

M = []
for i in range(32):
    X = []
    for j in range(5):
        if i >> j & 1:
            X.append(1)
        else:
            X.append(-1)
    ma = -float("inf")
    ma_idx = -1
    for k, line in enumerate(ABCDE):
        z = 0
        for j in range(5):
            z += line[j] * X[j]
        if z > ma:
            ma = z
            ma_idx = k
    M.append(ma_idx)

for i in range(N):
    line = ABCDE[i]
    ans = 0
    for j in range(32):
        line2 = ABCDE[M[j]]
        if i != j:
            ans = max(ans, dist(line, line2))
    print(ans)
0