結果
| 問題 |
No.2790 Athena 3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-21 21:33:39 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 796 bytes |
| コンパイル時間 | 2,523 ms |
| コンパイル使用メモリ | 243,648 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-21 21:33:43 |
| 合計ジャッジ時間 | 3,134 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
// Problem: No.2790 Athena 3
// Group: yukicoder
// URL: https://yukicoder.me/problems/no/2790
// Memory Limit: 512 MB
// Time Limit: 2000 ms
// Author: lingfunny
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using namespace std;
const int dx[] = { 0, 0, 1, -1 };
const int dy[] = { 1, -1, 0, 0 };
int x[3], y[3], ans;
int calc() {
int x1 = x[1] - x[0], x2 = x[2] - x[0];
int y1 = y[1] - y[0], y2 = y[2] - y[0];
return abs(y2 * x1 - y1 * x2);
}
void dfs(int i) {
if (i >= 3) {
ans = max(ans, calc());
return;
}
for (int d = 0; d < 4; ++d) {
x[i] += dx[d], y[i] += dy[d];
dfs(i + 1);
x[i] -= dx[d], y[i] -= dy[d];
}
}
int main() {
for (int i = 0; i <= 2; ++i)
scanf("%d%d", x + i, y + i);
dfs(0);
printf("%.1lf\n", ans * 0.5);
return 0;
}