結果
問題 |
No.2790 Athena 3
|
ユーザー |
|
提出日時 | 2024-07-03 19:51:15 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 907 bytes |
コンパイル時間 | 2,564 ms |
コンパイル使用メモリ | 244,004 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 19:51:19 |
合計ジャッジ時間 | 3,472 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #ifdef LOCAL #include <algo/debug.h> #else #define debug(...) void(0) #endif const int dx[] = {0, 1, 0, -1}; const int dy[] = {1, 0, -1, 0}; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); fixed(cout).precision(12); auto calc = [](int x1, int y1, int x2, int y2, int x3, int y3) -> ld { int a1 = x2 - x1, b1 = y2 - y1; int a2 = x3 - x1, b2 = y3 - y1; return abs(a1 * b2 - a2 * b1) / ld(2); }; ld ans = 0; int x1, y1, x2, y2, x3, y3; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; for(int i = 0; i < 4; i++) { for(int j = 0; j < 4; j++) { for(int k = 0; k < 4; k++) { ans = max(ans, calc(x1 + dx[i], y1 + dy[i], x2 + dx[j], y2 + dy[j], x3 + dx[k], y3 + dy[k])); } } } cout << ans << endl; }