結果
| 問題 |
No.2790 Athena 3
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2024-06-21 22:59:17 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 140 ms / 2,000 ms |
| コード長 | 806 bytes |
| コンパイル時間 | 2,906 ms |
| コンパイル使用メモリ | 77,156 KB |
| 実行使用メモリ | 54,216 KB |
| 最終ジャッジ日時 | 2024-06-21 22:59:24 |
| 合計ジャッジ時間 | 6,321 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int[] x = new int[3];
int[] y = new int[3];
for (int i = 0; i < 3; i++) {
x[i] = sc.nextInt();
y[i] = sc.nextInt();
}
sc.close();
int[] dx = {1, 0, -1, 0};
int[] dy = {0, 1, 0, -1};
int max = 0;
for (int i = 0; i < 4; i++) {
int x1 = x[0] + dx[i];
int y1 = y[0] + dy[i];
for (int j = 0; j < 4; j++) {
int x2 = x[1] + dx[j];
int y2 = y[1] + dy[j];
for (int k = 0; k < 4; k++) {
int x3 = x[2] + dx[k];
int y3 = y[2] + dy[k];
int s = x1 * y2 + x2 * y3 + x3 * y1 - y1 * x2 - y2 * x3 - y3 * x1;
int s2 = Math.abs(s);
max = Math.max(max, s2);
}
}
}
System.out.println(max / 2.0);
}
}
ks2m