結果
| 問題 |
No.2790 Athena 3
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2024-07-11 14:18:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 691 bytes |
| コンパイル時間 | 1,933 ms |
| コンパイル使用メモリ | 169,412 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-11 14:18:47 |
| 合計ジャッジ時間 | 3,151 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
int main() {
vector<double> x(3), y(3);
rep(i, 3) cin >> x[i] >> y[i];
int c = 4 * 4 * 4;
double ans = 0;
rep(i, c) {
vector<double> tx = x;
vector<double> ty = y;
int ii = i;
rep(j, 3) {
int m = ii % 4;
ii /= 4;
if(m == 0) tx[j]++;
if(m == 1) tx[j]--;
if(m == 2) ty[j]++;
if(m == 3) ty[j]--;
double vx1 = tx[0] - tx[2];
double vy1 = ty[0] - ty[2];
double vx2 = tx[1] - tx[2];
double vy2 = ty[1] - ty[2];
double s = abs(vx1 * vy2 - vx2 * vy1) / 2;
ans = max(ans, s);
}
}
cout << fixed << setprecision(1) << ans << endl;
}
forest3