結果
問題 |
No.3180 angles sum
|
ユーザー |
|
提出日時 | 2025-06-15 00:23:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 162 ms / 2,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 1,929 ms |
コンパイル使用メモリ | 195,628 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-15 00:23:35 |
合計ジャッジ時間 | 5,561 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; bool solve(){ ll x1, y1, x2, y2, x3, y3; cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3; if(y1 == 0 && y2 == 0 && x3 < 0) return false; if(x1 * y2 < x2 * y1){ swap(x1, x2); swap(y1, y2); } complex<long double> p1(x1, y1), p3(x3, y3); p3 /= p1; return abs(x2 * p3.imag() - p3.real() * y2) <= 1e-10; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--) cout << (solve() ? "Yes" : "No") << '\n'; }