結果
問題 | No.1144 Triangles |
ユーザー |
![]() |
提出日時 | 2020-07-31 23:31:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,194 bytes |
コンパイル時間 | 2,541 ms |
コンパイル使用メモリ | 218,332 KB |
最終ジャッジ日時 | 2025-01-12 11:50:35 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 8 WA * 3 TLE * 14 |
ソースコード
#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; } 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]; } int 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; }