結果

問題 No.2261 Coffee
ユーザー 👑 H20H20
提出日時 2023-04-07 21:42:05
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 699 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 83,792 KB
最終ジャッジ日時 2024-04-10 16:48:36
合計ジャッジ時間 5,382 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
60,856 KB
testcase_01 AC 39 ms
55,152 KB
testcase_02 AC 38 ms
54,304 KB
testcase_03 AC 38 ms
53,940 KB
testcase_04 AC 39 ms
54,796 KB
testcase_05 AC 48 ms
64,136 KB
testcase_06 AC 59 ms
68,584 KB
testcase_07 AC 39 ms
53,800 KB
testcase_08 AC 58 ms
68,516 KB
testcase_09 AC 50 ms
63,628 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
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 #

import collections
N = int(input())
ABCDE = [list(map(int, input().split())) for _ in range(N)]
candidate = set()
for i in range(2 ** N):
    PATTERN = []
    for j in range(N):
        if ((i >> j) & 1):
            PATTERN.append(10**16)
        else:
            PATTERN.append(0)
    max_v = 0
    max_j = 0
    for j,(abcde) in enumerate(ABCDE):
        v = 0
        for p,a in zip(PATTERN,abcde):
            v+=abs(p-a)
        if max_v<v:
            max_v = v
            max_j = j
    candidate.add(max_j)
for abcde in ABCDE:
    max_v = 0
    for i in candidate:
        v = 0
        for c,a in zip(ABCDE[i],abcde):
            v+=abs(c-a)
        max_v = max(max_v,v)
    print(max_v)
0