結果
| 問題 |
No.3180 angles sum
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-14 12:16:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 720 ms / 2,000 ms |
| コード長 | 551 bytes |
| コンパイル時間 | 1,926 ms |
| コンパイル使用メモリ | 195,000 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-14 12:16:59 |
| 合計ジャッジ時間 | 12,732 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
ll ax, ay, bx, by, cx, cy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
ll dx = ax * bx - ay * by, dy = ay * bx + by * ax;
ll g = gcd(abs(dx), abs(dy));
// dx /= g; dy /= g;
if (dy && dx) cout << ((dx * cy == dy * cx) ? "Yes" : "No") << endl;
else {
if (dy < 0) {
dx *= -1; dy *= -1;
}
cout << (((dx < 0) == (cx < 0)) && ((dy < 0) == (cy < 0)) && ((dx * cy == dy * cx)) ? "Yes" : "No") << endl;
}
}
int main () {
int T;
cin >> T;
while (T--) solve();
}