結果

問題 No.2261 Coffee
ユーザー fiblonariafiblonaria
提出日時 2023-04-11 00:37:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,047 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 97,556 KB
最終ジャッジ日時 2024-04-16 02:14:50
合計ジャッジ時間 27,389 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,352 KB
testcase_01 AC 42 ms
58,496 KB
testcase_02 AC 39 ms
52,352 KB
testcase_03 AC 39 ms
52,224 KB
testcase_04 AC 43 ms
58,240 KB
testcase_05 AC 44 ms
59,264 KB
testcase_06 AC 47 ms
59,264 KB
testcase_07 AC 42 ms
57,344 KB
testcase_08 AC 45 ms
59,520 KB
testcase_09 AC 45 ms
59,008 KB
testcase_10 AC 60 ms
71,040 KB
testcase_11 AC 63 ms
72,832 KB
testcase_12 AC 61 ms
68,992 KB
testcase_13 AC 57 ms
67,968 KB
testcase_14 AC 60 ms
71,040 KB
testcase_15 AC 57 ms
66,944 KB
testcase_16 AC 57 ms
67,968 KB
testcase_17 AC 108 ms
77,656 KB
testcase_18 AC 107 ms
77,300 KB
testcase_19 AC 102 ms
77,156 KB
testcase_20 AC 101 ms
77,184 KB
testcase_21 AC 106 ms
77,108 KB
testcase_22 AC 103 ms
76,924 KB
testcase_23 AC 108 ms
77,568 KB
testcase_24 AC 966 ms
93,312 KB
testcase_25 AC 815 ms
90,624 KB
testcase_26 AC 1,016 ms
94,088 KB
testcase_27 AC 957 ms
92,984 KB
testcase_28 AC 839 ms
93,940 KB
testcase_29 AC 833 ms
93,496 KB
testcase_30 AC 649 ms
89,460 KB
testcase_31 AC 993 ms
97,364 KB
testcase_32 AC 978 ms
97,556 KB
testcase_33 AC 979 ms
97,280 KB
testcase_34 AC 960 ms
97,380 KB
testcase_35 AC 978 ms
97,024 KB
testcase_36 AC 958 ms
96,784 KB
testcase_37 AC 971 ms
97,408 KB
testcase_38 AC 1,021 ms
94,336 KB
testcase_39 AC 1,047 ms
94,336 KB
testcase_40 AC 1,032 ms
94,496 KB
testcase_41 AC 1,035 ms
94,416 KB
testcase_42 AC 1,039 ms
94,608 KB
testcase_43 AC 1,033 ms
94,144 KB
testcase_44 AC 1,031 ms
94,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(A, index):
	ans = 0
	for i in range(5):
		ans += A[i] * (index % 2 * 2 - 1)
		index //= 2
	return ans
N = int(input())
items = [None for i in range(N)]
dp = [-float('inf') for i in range(2 ** 5)]
for i in range(N):
	items[i] = list(map(int, input().split()))
	for j in range(2 ** 5):
		dp[j] = max(dp[j], calc(items[i], j))
for i in range(N):
	ans = -float('inf')
	for j in range(2 ** 5):
		ans = max(ans, dp[j] - calc(items[i], j))
	print(ans)
0