結果

問題 No.2331 Maximum Quadrilateral
ユーザー m_99m_99
提出日時 2023-05-28 14:35:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,019 bytes
コンパイル時間 3,849 ms
コンパイル使用メモリ 226,132 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-27 10:09:22
合計ジャッジ時間 8,541 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
4,376 KB
testcase_01 AC 104 ms
4,380 KB
testcase_02 AC 125 ms
4,376 KB
testcase_03 AC 126 ms
4,376 KB
testcase_04 AC 162 ms
4,380 KB
testcase_05 AC 173 ms
4,376 KB
testcase_06 AC 161 ms
4,376 KB
testcase_07 AC 143 ms
4,376 KB
testcase_08 AC 102 ms
4,376 KB
testcase_09 AC 93 ms
4,376 KB
testcase_10 AC 85 ms
4,376 KB
testcase_11 AC 93 ms
4,380 KB
testcase_12 AC 85 ms
4,376 KB
testcase_13 AC 90 ms
4,376 KB
testcase_14 AC 176 ms
4,376 KB
testcase_15 AC 16 ms
4,380 KB
testcase_16 AC 60 ms
4,380 KB
testcase_17 AC 5 ms
4,376 KB
testcase_18 AC 19 ms
4,380 KB
testcase_19 AC 6 ms
4,376 KB
testcase_20 AC 196 ms
4,380 KB
testcase_21 AC 197 ms
4,380 KB
testcase_22 AC 192 ms
4,380 KB
testcase_23 AC 195 ms
4,376 KB
testcase_24 AC 194 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 WA -
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 2 ms
4,380 KB
testcase_39 AC 2 ms
4,380 KB
testcase_40 AC 1 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 2 ms
4,376 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001

int check(long long x0,long long y0,long long x1,long long y1,long long x2,long long y2){
	return (x1-x0) * (y2-y1) - (y1-y0) * (x2-x1);
}

long long get(long long x0,long long y0,long long x1,long long y1,long long x2,long long y2){
	x0 -= x2;
	y0 -= y2;
	x1 -= x2;
	y1 -= y2;
	return abs(x0*y1 - x1*y0);
}

int main(){
	
	int N;
	cin>>N;
	
	vector<long long> x(N),y(N);
	rep(i,N){
		cin>>x[i]>>y[i];
	}
	
	long long ans = 0;
	rep(i,N){
		for(int j=i+1;j<N;j++){
			long long X = 0,Y = 0;
			rep(k,N){
				long long v = check(x[i],y[i],x[k],y[k],x[j],y[j]);
				if(v<0){
					X = max(X,get(x[i],y[i],x[j],y[j],x[k],y[k]));
				}
				if(v>0){
					Y = max(Y,get(x[i],y[i],x[j],y[j],x[k],y[k]));
				}
			}
			ans = max(ans,X+Y);
		}
	}
	cout<<ans<<endl;
	
	return 0;
}
0