結果

問題 No.2790 Athena 3
ユーザー けーけーけーけー
提出日時 2024-06-21 21:31:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 710 bytes
コンパイル時間 2,438 ms
コンパイル使用メモリ 203,412 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-21 21:31:59
合計ジャッジ時間 2,827 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll = long long;

double f(double x1, double y1, double x2, double y2, double x3, double y3) {
    double area = 0.5 * abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));
    return area;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int x1,y1,x2,y2,x3,y3;
    cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
    vector<int> dx = {1,-1,0,0};
    vector<int> dy = {0,0,1,-1};
    double ma = 0;
    rep(i,4){
        rep(j,4){
            rep(l,4){
                ma = max(ma,f(x1+dx[i],y1+dy[i],x2+dx[j],y2+dy[j],x3+dx[l],y3+dy[l]));
            }
        }
    }
    cout << ma << endl;
}
0