結果

問題 No.2261 Coffee
ユーザー kotatsugamekotatsugame
提出日時 2023-04-07 21:33:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 348 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 70,128 KB
実行使用メモリ 28,672 KB
最終ジャッジ日時 2024-04-10 16:40:14
合計ジャッジ時間 8,588 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 11 ms
5,376 KB
testcase_18 AC 11 ms
5,376 KB
testcase_19 AC 10 ms
5,376 KB
testcase_20 AC 8 ms
5,376 KB
testcase_21 AC 11 ms
5,376 KB
testcase_22 AC 9 ms
5,376 KB
testcase_23 AC 11 ms
5,376 KB
testcase_24 AC 315 ms
26,932 KB
testcase_25 AC 272 ms
23,552 KB
testcase_26 AC 338 ms
28,416 KB
testcase_27 AC 313 ms
26,496 KB
testcase_28 AC 110 ms
24,576 KB
testcase_29 AC 104 ms
24,192 KB
testcase_30 AC 81 ms
19,456 KB
testcase_31 AC 141 ms
28,416 KB
testcase_32 AC 140 ms
28,544 KB
testcase_33 AC 140 ms
28,544 KB
testcase_34 AC 140 ms
28,672 KB
testcase_35 AC 140 ms
28,672 KB
testcase_36 AC 143 ms
28,544 KB
testcase_37 AC 140 ms
28,544 KB
testcase_38 AC 340 ms
28,544 KB
testcase_39 AC 343 ms
28,544 KB
testcase_40 AC 339 ms
28,672 KB
testcase_41 AC 343 ms
28,416 KB
testcase_42 AC 348 ms
28,544 KB
testcase_43 AC 346 ms
28,544 KB
testcase_44 AC 338 ms
28,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
long T[1<<17][1<<5];
long MN[1<<5];
int main()
{
	cin>>N;
	for(int i=0;i<1<<5;i++)MN[i]=9e18;
	for(int i=0;i<N;i++)
	{
		long A[5];
		for(int j=0;j<5;j++)cin>>A[j];
		for(int j=0;j<1<<5;j++)
		{
			long now=0;
			for(int k=0;k<5;k++)now+=j>>k&1?A[k]:-A[k];
			T[i][j]=now;
			MN[j]=min(MN[j],now);
		}
	}
	for(int i=0;i<N;i++)
	{
		long ans=0;
		for(int j=0;j<1<<5;j++)ans=max(ans,T[i][j]-MN[j]);
		cout<<ans<<"\n";
	}
}
0