結果
問題 |
No.1144 Triangles
|
ユーザー |
![]() |
提出日時 | 2020-07-31 23:34:59 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,617 bytes |
コンパイル時間 | 5,658 ms |
コンパイル使用メモリ | 159,524 KB |
最終ジャッジ日時 | 2025-01-12 11:52:56 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 TLE * 8 |
コンパイルメッセージ
main.cpp:27:28: warning: bad option '-favx2' to pragma 'optimize' [-Wpragmas] 27 | #pragma GCC optimize("avx2") | ^ main.cpp:40:62: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes] 40 | template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } | ^ main.cpp:41:62: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes] 41 | template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; } | ^ main.cpp:45:10: warning: bad option '-favx2' to attribute 'optimize' [-Wattributes] 45 | int main() { | ^
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <queue> #include <stack> #include <set> #include <map> #include <iomanip> #include <utility> #include <tuple> #include <functional> #include <bitset> #include <cassert> #include <complex> #include <stdio.h> #include <time.h> #include <numeric> #include <random> #include <unordered_map> #include <unordered_set> #define all(a) a.begin(),a.end() #define rep(i, n) for (ll i = 0; i < (n); i++) #define pb push_back #define debug(x) cerr << #x << ':' << x << '\n' #pragma GCC optimize("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<ll, ll> P; typedef complex<ld> com; constexpr int inf = 1000000010; constexpr ll INF = 1000000000000000010; constexpr ld eps = 1e-12; constexpr ld pi = 3.141592653589793238; template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; } constexpr ll mod = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int n; cin >> n; vector<int> x(n), y(n); rep(i, n) cin >> x[i] >> y[i]; ll ans = 0; rep(i, n) { rep(j, i) { rep(k, j) { int tmp = (x[j] - x[i])*(y[k] - y[i]) - (y[j] - y[i])*(x[k] - x[i]); if (tmp < 0) tmp = -tmp; ans += tmp; if (ans >= mod) ans -= mod; } } } cout << ans << '\n'; }