結果

問題 No.1144 Triangles
ユーザー ei1333333ei1333333
提出日時 2020-07-31 22:50:03
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 918 ms / 3,000 ms
コード長 555 bytes
コンパイル時間 2,226 ms
コンパイル使用メモリ 201,720 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-21 01:30:49
合計ジャッジ時間 14,745 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 918 ms
4,380 KB
testcase_05 AC 914 ms
4,376 KB
testcase_06 AC 915 ms
4,376 KB
testcase_07 AC 916 ms
4,380 KB
testcase_08 AC 911 ms
4,384 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 809 ms
4,380 KB
testcase_15 AC 797 ms
4,380 KB
testcase_16 AC 867 ms
4,380 KB
testcase_17 AC 875 ms
4,376 KB
testcase_18 AC 874 ms
4,380 KB
testcase_19 AC 58 ms
4,376 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 828 ms
4,376 KB
testcase_23 AC 16 ms
4,376 KB
testcase_24 AC 805 ms
4,376 KB
testcase_25 AC 161 ms
4,376 KB
testcase_26 AC 8 ms
4,376 KB
testcase_27 AC 841 ms
4,376 KB
testcase_28 AC 86 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")

int main() {
  int n, x[2000], y[2000];
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  int64 ret = 0;
  for(int i = 0; i < n; i++) {
    for(int j = i + 1; j < n; j++) {
      for(int z = j + 1; z < n; z++) {
        ret += abs((x[j] - x[i]) * (y[j] + y[i]) + (x[i] - x[z]) * (y[i] + y[z]) + (x[z] - x[j]) * (y[z] + y[j]));
      }
    }
  }
  cout << ret % mod << "\n";
}

0