結果
問題 | No.2261 Coffee |
ユーザー | tamato |
提出日時 | 2023-04-07 22:23:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,141 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 82,312 KB |
実行使用メモリ | 106,928 KB |
最終ジャッジ日時 | 2024-04-10 17:23:58 |
合計ジャッジ時間 | 7,648 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 45 ms
69,932 KB |
testcase_01 | AC | 51 ms
66,896 KB |
testcase_02 | AC | 47 ms
62,328 KB |
testcase_03 | AC | 48 ms
62,560 KB |
testcase_04 | AC | 56 ms
66,052 KB |
testcase_05 | AC | 55 ms
68,980 KB |
testcase_06 | AC | 58 ms
70,172 KB |
testcase_07 | AC | 52 ms
65,664 KB |
testcase_08 | AC | 65 ms
69,428 KB |
testcase_09 | AC | 56 ms
67,956 KB |
testcase_10 | AC | 85 ms
77,424 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 81 ms
77,196 KB |
testcase_14 | AC | 83 ms
77,124 KB |
testcase_15 | AC | 79 ms
77,368 KB |
testcase_16 | AC | 82 ms
77,680 KB |
testcase_17 | AC | 208 ms
78,068 KB |
testcase_18 | WA | - |
testcase_19 | AC | 184 ms
78,288 KB |
testcase_20 | AC | 170 ms
77,984 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 205 ms
78,076 KB |
testcase_24 | TLE | - |
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 | -- | - |
ソースコード
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) for _ in range(100 - 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)