結果

問題 No.2261 Coffee
ユーザー 👑 H20H20
提出日時 2023-04-07 21:42:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 928 ms / 2,000 ms
コード長 699 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,496 KB
実行使用メモリ 92,544 KB
最終ジャッジ日時 2024-04-10 16:50:01
合計ジャッジ時間 22,757 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,016 KB
testcase_01 AC 41 ms
54,400 KB
testcase_02 AC 41 ms
54,144 KB
testcase_03 AC 42 ms
54,016 KB
testcase_04 AC 41 ms
53,888 KB
testcase_05 AC 46 ms
60,928 KB
testcase_06 AC 46 ms
61,952 KB
testcase_07 AC 42 ms
54,272 KB
testcase_08 AC 48 ms
61,184 KB
testcase_09 AC 46 ms
60,416 KB
testcase_10 AC 69 ms
69,760 KB
testcase_11 AC 66 ms
70,528 KB
testcase_12 AC 64 ms
69,248 KB
testcase_13 AC 63 ms
68,864 KB
testcase_14 AC 65 ms
70,536 KB
testcase_15 AC 64 ms
69,632 KB
testcase_16 AC 64 ms
69,248 KB
testcase_17 AC 126 ms
78,080 KB
testcase_18 AC 127 ms
78,216 KB
testcase_19 AC 121 ms
77,876 KB
testcase_20 AC 115 ms
77,568 KB
testcase_21 AC 122 ms
77,848 KB
testcase_22 AC 117 ms
77,336 KB
testcase_23 AC 124 ms
77,636 KB
testcase_24 AC 863 ms
90,388 KB
testcase_25 AC 761 ms
88,848 KB
testcase_26 AC 928 ms
91,136 KB
testcase_27 AC 861 ms
90,496 KB
testcase_28 AC 747 ms
89,684 KB
testcase_29 AC 741 ms
89,992 KB
testcase_30 AC 594 ms
87,012 KB
testcase_31 AC 852 ms
92,544 KB
testcase_32 AC 863 ms
92,412 KB
testcase_33 AC 872 ms
92,420 KB
testcase_34 AC 869 ms
92,488 KB
testcase_35 AC 864 ms
92,404 KB
testcase_36 AC 879 ms
92,416 KB
testcase_37 AC 874 ms
92,432 KB
testcase_38 AC 886 ms
91,264 KB
testcase_39 AC 906 ms
91,264 KB
testcase_40 AC 891 ms
91,320 KB
testcase_41 AC 890 ms
91,040 KB
testcase_42 AC 889 ms
91,100 KB
testcase_43 AC 907 ms
91,136 KB
testcase_44 AC 894 ms
91,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N = int(input())
ABCDE = [list(map(int, input().split())) for _ in range(N)]
candidate = set()
for i in range(2 ** 5):
    PATTERN = []
    for j in range(5):
        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