結果

問題 No.2331 Maximum Quadrilateral
ユーザー shobonvipshobonvip
提出日時 2023-05-28 15:13:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 674 bytes
コンパイル時間 4,486 ms
コンパイル使用メモリ 261,976 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 11:40:36
合計ジャッジ時間 27,501 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,202 ms
4,380 KB
testcase_01 AC 706 ms
4,376 KB
testcase_02 AC 859 ms
4,376 KB
testcase_03 AC 861 ms
4,376 KB
testcase_04 AC 1,114 ms
4,376 KB
testcase_05 AC 1,186 ms
4,380 KB
testcase_06 AC 1,112 ms
4,380 KB
testcase_07 AC 982 ms
4,376 KB
testcase_08 AC 683 ms
4,380 KB
testcase_09 AC 627 ms
4,376 KB
testcase_10 AC 570 ms
4,376 KB
testcase_11 AC 619 ms
4,376 KB
testcase_12 AC 564 ms
4,376 KB
testcase_13 AC 602 ms
4,376 KB
testcase_14 AC 1,241 ms
4,384 KB
testcase_15 AC 82 ms
4,376 KB
testcase_16 AC 395 ms
4,376 KB
testcase_17 AC 18 ms
4,376 KB
testcase_18 AC 104 ms
4,376 KB
testcase_19 AC 27 ms
4,376 KB
testcase_20 AC 1,354 ms
4,380 KB
testcase_21 AC 1,358 ms
4,376 KB
testcase_22 AC 1,365 ms
4,376 KB
testcase_23 AC 1,366 ms
4,376 KB
testcase_24 AC 1,352 ms
4,384 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 WA -
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 1 ms
4,384 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 1 ms
4,380 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 2 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 1 ms
4,380 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;

typedef modint998244353 mint;
typedef long long ll;

ll val(ll x1, ll y1, ll x2, ll y2, ll x, ll y){
	return (x2 - x1) * (y - y1) - (y2 - y1) * (x - x1);
}

int main(){
	int n; cin >> n;
	vector<ll> x(n), y(n);
	for (int i=0; i<n; i++){
		cin >> x[i] >> y[i];
	}
	ll ans = 0;
	for (int i=0; i<n; i++){
		for (int j=i+1; j<n; j++){
			vector<ll> ar;
			for (int k=0; k<n; k++){
				ll f = val(x[i], y[i], x[j], y[j], x[k], y[k]);
				if (val != 0) ar.push_back(f);
			}
			sort(ar.begin(), ar.end());
			ans = max(ans, ar[(int)ar.size()-1] - ar[0]);
		}
	}
	cout << ans << endl;
}

0