結果

問題 No.3180 angles sum
ユーザー jiangxinyang
提出日時 2025-06-13 22:06:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 894 bytes
コンパイル時間 1,696 ms
コンパイル使用メモリ 194,848 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-14 01:42:25
合計ジャッジ時間 4,849 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const int N = 200005;
const int INF = 0x3f3f3f3f;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int _;
    cin >> _;
    while (_--) {
        ll ax, ay, bx, by, cx, cy;
        cin >> ax >> ay >> bx >> by >> cx >> cy;
        bool ok = 0;
        if (ay == 0 && by == 0) {
            if (cy == 0 && cx > 0) ok = 1;
        } else {
            __int128 x = ((__int128)ax * bx - ((__int128)ay * by));
            __int128 y = ((__int128)ay * bx + ((__int128)by * ax));
            if (x == 0) {
                if (cx == 0 && cy > 0) ok = 1;
            } else {
                if (y * cx == (__int128)cy * x) ok = 1;
            }
        }
        if (ok) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }
    return 0;
}
0