結果

問題 No.2331 Maximum Quadrilateral
ユーザー kotatsugamekotatsugame
提出日時 2023-05-28 14:26:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 65,244 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 09:46:37
合計ジャッジ時間 5,734 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 176 ms
4,380 KB
testcase_01 AC 107 ms
4,380 KB
testcase_02 AC 129 ms
4,380 KB
testcase_03 AC 128 ms
4,380 KB
testcase_04 AC 166 ms
4,380 KB
testcase_05 AC 175 ms
4,380 KB
testcase_06 AC 165 ms
4,380 KB
testcase_07 AC 147 ms
4,376 KB
testcase_08 AC 104 ms
4,376 KB
testcase_09 AC 97 ms
4,376 KB
testcase_10 AC 88 ms
4,380 KB
testcase_11 AC 95 ms
4,380 KB
testcase_12 AC 87 ms
4,376 KB
testcase_13 AC 93 ms
4,380 KB
testcase_14 AC 183 ms
4,380 KB
testcase_15 AC 16 ms
4,380 KB
testcase_16 AC 62 ms
4,376 KB
testcase_17 AC 5 ms
4,376 KB
testcase_18 AC 19 ms
4,376 KB
testcase_19 AC 6 ms
4,380 KB
testcase_20 AC 198 ms
4,380 KB
testcase_21 AC 199 ms
4,380 KB
testcase_22 AC 198 ms
4,380 KB
testcase_23 AC 199 ms
4,376 KB
testcase_24 AC 199 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 WA -
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,380 KB
testcase_38 AC 2 ms
4,376 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 1 ms
4,376 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 2 ms
4,380 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;
int N;
int X[400],Y[400];
int C[400][400];
int cross(int i,int j){return X[i]*Y[j]-X[j]*Y[i];}
int dp[3][400];
int main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>X[i]>>Y[i];
	for(int i=0;i<N;i++)for(int j=0;j<N;j++)C[i][j]=cross(i,j);
	int ans=-2e9;
	for(int s=0;s<N;s++)
	{
		for(int t=0;t<N;t++)dp[0][t]=C[s][t];
		for(int k=0;k<2;k++)
		{
			for(int j=0;j<N;j++)dp[k+1][j]=-2e9;
			for(int i=0;i<N;i++)for(int j=0;j<N;j++)
			{
				dp[k+1][j]=max(dp[k+1][j],dp[k][i]+C[i][j]);
			}
		}
		for(int i=0;i<N;i++)ans=max(ans,dp[2][i]+C[i][s]);
	}
	cout<<ans<<endl;
}
0