結果
| 問題 |
No.2790 Athena 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-21 22:11:42 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 831 bytes |
| コンパイル時間 | 3,269 ms |
| コンパイル使用メモリ | 278,048 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-21 22:11:48 |
| 合計ジャッジ時間 | 4,445 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
vector<int> dx = {1, 0, -1, 0};
vector<int> dy = {0, 1, 0, -1};
int main() {
vector<int> x(3), y(3);
for (int i = 0; i < 3; i++) {
cin >> x[i] >> y[i];
}
double ans = 0;
for (int i = 0; i < 4 * 4 * 4; i++) {
int ni = i;
int i0 = ni % 4;
ni /= 4;
int i1 = ni % 4;
ni /= 4;
int i2 = ni % 4;
vector<int> nx = x;
vector<int> ny = y;
nx[0] = x[0] + dx[i0];
nx[1] = x[1] + dx[i1];
nx[2] = x[2] + dx[i2];
ny[0] = y[0] + dy[i0];
ny[1] = y[1] + dy[i1];
ny[2] = y[2] + dy[i2];
ans = max<double>(ans, abs((nx[0] - nx[2]) * (ny[1] - ny[2]) - (nx[1] - nx[2]) * (ny[0] - ny[2])));
ans = max<double>(ans, abs((nx[1] - nx[0]) * (ny[2] - ny[0]) - (ny[1] - ny[0]) * (nx[2] - nx[0])));
}
ans /= 2;
printf("%.1f\n",ans);
}