結果

問題 No.1144 Triangles
ユーザー NNMochiNNMochi
提出日時 2020-07-31 23:36:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 382 ms / 3,000 ms
コード長 1,287 bytes
コンパイル時間 1,512 ms
コンパイル使用メモリ 169,584 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 03:12:42
合計ジャッジ時間 7,460 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 380 ms
4,376 KB
testcase_05 AC 381 ms
4,380 KB
testcase_06 AC 382 ms
4,380 KB
testcase_07 AC 379 ms
4,380 KB
testcase_08 AC 379 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 337 ms
4,376 KB
testcase_15 AC 333 ms
4,376 KB
testcase_16 AC 362 ms
4,376 KB
testcase_17 AC 366 ms
4,376 KB
testcase_18 AC 364 ms
4,376 KB
testcase_19 AC 26 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 3 ms
4,380 KB
testcase_22 AC 347 ms
4,376 KB
testcase_23 AC 8 ms
4,376 KB
testcase_24 AC 339 ms
4,376 KB
testcase_25 AC 68 ms
4,376 KB
testcase_26 AC 5 ms
4,380 KB
testcase_27 AC 351 ms
4,380 KB
testcase_28 AC 37 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
using namespace std;
using ll=long long;
using ld=long double;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
struct edge{ll to,cost;};
struct edge2{ll from,to,cost;};

template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<int> x(n),y(n);
    rep(i,n){
        cin >> x[i] >> y[i];
    }
    ll ans=0;
    rep(i,n-2){
        FOR(j,i+1,n-1){
            FOR(k,j+1,n){
                ans+=abs((x[j]-x[i])*(y[k]-y[i])-(x[k]-x[i])*(y[j]-y[i]));
            }
        }
    }
    cout << ans%MOD << endl;
}
0