結果
| 問題 | No.2628 Shrinkage | 
| コンテスト | |
| ユーザー |  SnowBeenDiding | 
| 提出日時 | 2024-02-16 22:17:15 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 860 bytes | 
| コンパイル時間 | 5,182 ms | 
| コンパイル使用メモリ | 309,328 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-09-28 20:53:22 | 
| 合計ジャッジ時間 | 6,087 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 WA * 27 | 
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace std;
using namespace atcoder;
typedef long long ll;
ll dist(ll x1, ll y1, ll x2, ll y2) {
    return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
void sol() {
    ll a, b, c, d, e, f, g, h;
    cin >> a >> b >> c >> d >> e >> f >> g >> h;
    if (a == e && b == f && c == g && d == h) {
        cout << "Yes" << endl;
        return;
    }
    ll px = a - c;
    ll py = b - d;
    ll qx = e - g;
    ll qy = f - h;
    // pベクトルとqベクトルが平行ならtrue
    bool tmp = (px * qy == py * qx);
    if (dist(a, b, c, d) > dist(e, f, g, h) && tmp) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}
int main() {
    int t;
    cin >> t;
    rep(i, 0, t) { sol(); }
    return 0;
}
            
            
            
        