結果

問題 No.2331 Maximum Quadrilateral
ユーザー firiexpfiriexp
提出日時 2023-05-16 17:16:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 863 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 103,884 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 07:11:37
合計ジャッジ時間 5,157 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
4,376 KB
testcase_01 AC 62 ms
4,380 KB
testcase_02 AC 75 ms
4,380 KB
testcase_03 AC 76 ms
4,376 KB
testcase_04 AC 97 ms
4,376 KB
testcase_05 AC 102 ms
4,376 KB
testcase_06 AC 96 ms
4,376 KB
testcase_07 AC 86 ms
4,380 KB
testcase_08 AC 61 ms
4,376 KB
testcase_09 AC 57 ms
4,376 KB
testcase_10 AC 52 ms
4,380 KB
testcase_11 AC 55 ms
4,380 KB
testcase_12 AC 51 ms
4,380 KB
testcase_13 AC 54 ms
4,380 KB
testcase_14 AC 108 ms
4,376 KB
testcase_15 AC 9 ms
4,376 KB
testcase_16 AC 37 ms
4,380 KB
testcase_17 AC 3 ms
4,380 KB
testcase_18 AC 12 ms
4,376 KB
testcase_19 AC 5 ms
4,380 KB
testcase_20 AC 116 ms
4,380 KB
testcase_21 AC 116 ms
4,376 KB
testcase_22 AC 117 ms
4,376 KB
testcase_23 AC 119 ms
4,376 KB
testcase_24 AC 117 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 2 ms
4,376 KB
testcase_37 AC 1 ms
4,376 KB
testcase_38 AC 1 ms
4,376 KB
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 AC 1 ms
4,380 KB
testcase_43 AC 2 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 2 ms
4,380 KB
testcase_46 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

using namespace std;

using ll = long long;
using uint = unsigned;
using ull = unsigned long long;

int main() {
    int n;
    cin >> n;
    vector<int> X(n), Y(n);
    for (int i = 0; i < n; ++i) {
        cin >> X[i] >> Y[i];
    }
    vector<int> U(n-2);
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = i+1; j < n; ++j) {
            int cur = 0;
            for (int k = 0; k < n; ++k) {
                if(i == k || j == k) continue;
                U[cur++] = (X[k]-X[i])*(Y[j]-Y[i])-(Y[k]-Y[i])*(X[j]-X[i]);
            }
            ans = max(ans, *max_element(U.begin(),U.end())-*min_element(U.begin(),U.end()));
        }
    }
    cout << ans << "\n";
    return 0;
}
0