結果
問題 |
No.2790 Athena 3
|
ユーザー |
|
提出日時 | 2024-06-26 23:14:03 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 760 bytes |
コンパイル時間 | 3,095 ms |
コンパイル使用メモリ | 245,612 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 23:14:07 |
合計ジャッジ時間 | 3,916 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; //#include<atcoder/all> //using namespace atcoder; typedef long long ll; typedef pair<ll,ll> pll; #define rep(i,n) for(ll i=0;i<n;i++) #define chmin(a,b) a=min(a,b) #define chmax(a,b) a=max(a,b) #define all(a) a.begin(),a.end() const int INF=1001001001; double calculateArea(double x1, double x2, double x3, double y1, double y2,double y3) { return abs((x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)) / 2.0); } int main(){ int x[3],y[3]; rep(i,3){ cin>>x[i]>>y[i]; } int dx[]={0,0,1,-1}; int dy[]={1,-1,0,0}; double ans=0; rep(i,4){ rep(j,4){ rep(k,4){ chmax(ans,calculateArea(x[0]+dx[i],x[1]+dx[j],x[2]+dx[k], y[0]+dy[i],y[1]+dy[j],y[2]+dy[k])); } } } cout<<setprecision(10)<<ans<<endl; }