結果
問題 | No.2331 Maximum Quadrilateral |
ユーザー | Taiki0715 |
提出日時 | 2023-05-28 14:58:29 |
言語 | C++17(clang) (17.0.6 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 3,641 bytes |
コンパイル時間 | 6,133 ms |
コンパイル使用メモリ | 161,752 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-08 06:40:19 |
合計ジャッジ時間 | 47,084 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | AC | 1,259 ms
5,248 KB |
testcase_02 | AC | 1,547 ms
5,376 KB |
testcase_03 | AC | 1,560 ms
5,376 KB |
testcase_04 | TLE | - |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | AC | 1,794 ms
5,376 KB |
testcase_08 | AC | 1,235 ms
5,376 KB |
testcase_09 | AC | 1,133 ms
5,376 KB |
testcase_10 | AC | 1,037 ms
5,376 KB |
testcase_11 | AC | 1,130 ms
5,376 KB |
testcase_12 | AC | 1,029 ms
5,376 KB |
testcase_13 | AC | 1,121 ms
5,376 KB |
testcase_14 | TLE | - |
testcase_15 | AC | 152 ms
5,376 KB |
testcase_16 | AC | 718 ms
5,376 KB |
testcase_17 | AC | 33 ms
5,376 KB |
testcase_18 | AC | 194 ms
5,376 KB |
testcase_19 | AC | 51 ms
5,376 KB |
testcase_20 | TLE | - |
testcase_21 | TLE | - |
testcase_22 | TLE | - |
testcase_23 | TLE | - |
testcase_24 | TLE | - |
testcase_25 | AC | 2 ms
5,376 KB |
testcase_26 | AC | 2 ms
5,376 KB |
testcase_27 | AC | 2 ms
5,376 KB |
testcase_28 | AC | 2 ms
5,376 KB |
testcase_29 | AC | 1 ms
5,376 KB |
testcase_30 | AC | 2 ms
5,376 KB |
testcase_31 | AC | 1 ms
5,376 KB |
testcase_32 | AC | 2 ms
5,376 KB |
testcase_33 | AC | 2 ms
5,376 KB |
testcase_34 | AC | 2 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
testcase_36 | AC | 2 ms
5,376 KB |
testcase_37 | AC | 2 ms
5,376 KB |
testcase_38 | AC | 2 ms
5,376 KB |
testcase_39 | AC | 2 ms
5,376 KB |
testcase_40 | AC | 2 ms
5,376 KB |
testcase_41 | AC | 2 ms
5,376 KB |
testcase_42 | AC | 2 ms
5,376 KB |
testcase_43 | AC | 1 ms
5,376 KB |
testcase_44 | AC | 2 ms
5,376 KB |
testcase_45 | AC | 2 ms
5,376 KB |
testcase_46 | AC | 2 ms
5,376 KB |
ソースコード
#include <iostream> #include <vector> #include <set> #include <queue> #include <stack> #include <math.h> #include <cassert> #include <bitset> #include <map> #include <algorithm> #include <iterator> #include <string> #include <utility> #include <numeric> #include <regex> #include <complex> #include <atcoder/all> using namespace atcoder; using namespace std; using ll=long long; using ull=unsigned long long; using P=pair<ll,ll>; template<typename T>using minque=priority_queue<T,vector<T>,greater<T>>; template<typename T>bool chmax(T &a,const T &b){return (a<b?(a=b,true):false);} template<typename T>bool chmin(T &a,const T &b){return (a>b?(a=b,true):false);} template<typename T1,typename T2> ostream &operator<<(ostream &os,const pair<T1,T2>&p){ os<<p.first<<" "<<p.second; return os; } template<typename T1,typename T2> istream &operator>>(istream &is,pair<T1,T2>&p){ is>>p.first>>p.second; return is; } template<typename T> istream &operator>>(istream &is,vector<T> &a){ for(auto &i:a)is>>i; return is; } #define reps(i,a,n) for(int i=(a);i<(n);i++) #define rep(i,n) reps(i,0,n) #define all(x) x.begin(),x.end() ll myceil(ll a,ll b){return (a+b-1)/b;} using R=long double; using Point=complex<R>; constexpr R eps=1e-12; constexpr R pi=3.141592653589793238; inline bool equal(const R &a,const R &b){ return fabs(a-b)<eps; } Point unit_vector(const Point &a){return a/abs(a);} R dot(const Point &a,const Point &b){//内積 return a.real()*b.real()+a.imag()*b.imag(); } R cross(const Point &a,const Point &b){//外積 return a.real()*b.imag()-a.imag()*b.real(); } Point rotate(const Point &a,const R t){ return Point(cos(t)*a.real()-sin(t)*a.imag(),sin(t)*a.real()+cos(t)*a.imag()); } struct Line{ Point a,b; Line(Point a,Point b):a(a),b(b){} Line(R A,R B,R C){ assert(!(equal(A,0)&&equal(B,0))); if(equal(A,0)){ a=Point(0,C/B),b=Point(1,C/B); } else if(equal(B,0)){ a=Point(C/A,0),b=Point(C/A,1); } else{ a=Point(C/A,0),b=Point(0,C/B); } } }; Point projection(const Line &line,const Point &p){ long double t=dot(p-line.a,line.a-line.b)/norm(line.a-line.b); return line.a+(line.a-line.b)*t; } Point reflection(const Line &line,const Point &p){ return p+(projection(line,p)-p)*(long double)2; } bool ON(const Point &a,const Point &b,const Point &p){ if(a==p)return true; if(b==p)return true; if(!equal(cross(a-p,b-p),0))return false; return dot(a-p,b-p)<0; } Point crosspoint(const Line &a,const Line &b){ long double c=cross(a.b-a.a,b.b-b.a); long double d=cross(a.b-a.a,a.b-b.a); if(equal(abs(c),0)&&equal(abs(d),0))return b.a; return b.a+(b.b-b.a)*d/c; } Line suityokunitoubunsenn(const Point &a,const Point &b){ Point c=(a+b)*(long double)0.5; Point d=rotate(a-c,pi/2)+c; Line ret(c,d); return ret; } struct Circle{ Point p; R r; Circle(Point p,R r):p(p),r(r){} Circle(Point a,Point b,Point c){ assert(!equal(cross(b-a,c-a),0)); Line x=suityokunitoubunsenn(a,b),y=suityokunitoubunsenn(a,c); p=crosspoint(x,y); r=abs(a-p); } bool in(const Point &a){ return abs(a-p)<=r+eps; } }; int main(){ int n; cin>>n; vector<Point>a(n); rep(i,n){ R x,y; cin>>x>>y; a[i]={x,y}; } int ans=0; rep(i,n-1)reps(j,i+1,n){ vector<R>s,t; rep(k,n){ if(k==i||k==j)continue; R area=cross(a[i]-a[k],a[j]-a[k]); if(area>0)s.push_back(area); else t.push_back(-area); } sort(all(s),[&](auto x,auto y){return x>y;}); sort(all(t),[&](auto x,auto y){return x>y;}); if(s.empty()||t.empty())continue; chmax<int>(ans,s[0]+t[0]); } cout<<ans<<endl; }