結果

問題 No.2261 Coffee
ユーザー tamatotamato
提出日時 2023-04-07 22:24:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,154 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 109,344 KB
最終ジャッジ日時 2024-04-10 17:26:10
合計ジャッジ時間 13,310 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
56,948 KB
testcase_01 AC 46 ms
61,696 KB
testcase_02 AC 40 ms
55,040 KB
testcase_03 AC 42 ms
55,296 KB
testcase_04 AC 48 ms
61,824 KB
testcase_05 AC 49 ms
63,872 KB
testcase_06 AC 59 ms
67,208 KB
testcase_07 AC 42 ms
60,672 KB
testcase_08 AC 54 ms
66,768 KB
testcase_09 AC 49 ms
64,256 KB
testcase_10 AC 79 ms
77,196 KB
testcase_11 WA -
testcase_12 AC 77 ms
77,036 KB
testcase_13 AC 75 ms
77,184 KB
testcase_14 AC 81 ms
77,280 KB
testcase_15 WA -
testcase_16 AC 78 ms
76,928 KB
testcase_17 AC 206 ms
78,592 KB
testcase_18 AC 199 ms
78,336 KB
testcase_19 AC 150 ms
78,080 KB
testcase_20 AC 149 ms
78,080 KB
testcase_21 WA -
testcase_22 AC 150 ms
78,080 KB
testcase_23 AC 166 ms
78,208 KB
testcase_24 TLE -
testcase_25 WA -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 AC 1,907 ms
102,156 KB
testcase_29 AC 1,892 ms
101,648 KB
testcase_30 AC 1,461 ms
95,376 KB
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
mod = 998244353
from random import randint

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)

len_M = 60
for _ in range(len_M - 32):
    X = []
    for _ in range(5):
        X.append(randint(-5, 5))
    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(len(M)):
        line2 = ABCDE[M[j]]
        if i != j:
            ans = max(ans, dist(line, line2))
    print(ans)
0