結果
問題 | No.2790 Athena 3 |
ユーザー |
|
提出日時 | 2024-06-21 21:43:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,600 bytes |
コンパイル時間 | 1,571 ms |
コンパイル使用メモリ | 171,792 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-21 21:43:49 |
合計ジャッジ時間 | 2,511 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include<bits/stdc++.h>using namespace std;// OM NAMAH SHIVAY// #include<ext/pb_ds/assoc_container.hpp>// #include<ext/pb_ds/tree_policy.hpp>// using namespace __gnu_pbds;// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);#define endl "\n"#define int long long// int dx[4]={-1,0,1,0};// int dy[4]={0,1,0,-1};// int dx[8]={0,-1,-1,-1,0,1,1,1};// int dy[8]={1,1,0,-1,-1,-1,0,1};const int N = 200200;const int mod = 1e9+7;using ii = pair<int,int>;//write on copyint dx[5]={1,-1,0,0,0};int dy[5]={0,0,0,1,-1};double calc(ii a, ii b, ii c){double ans = 1.0*a.first*(b.second-c.second)+1.0*b.first*(c.second-a.second)+c.first*(a.second-b.second);return abs(ans)/2.0;}void solver(){vector<ii>arr;for(int i=0;i<3;i++){int x,y;cin>>x>>y;arr.push_back({x,y});}double ans = 0;for(int i=0;i<5;i++){for(int j=0;j<5;j++){for(int k=0;k<5;k++){int a = arr[0].first+dx[i];int b = arr[0].second+dy[i];int c = arr[1].first+dx[j];int d = arr[1].second+dy[j];int e = arr[2].first+dx[k];int f = arr[2].second+dy[k];ans = max(ans, calc({a,b},{c,d},{e,f}));}}}cout<<ans<<endl;}signed main(){IOS//int _t;cin>>_t;while(_t--)solver();return 0;}#undef int