結果

問題 No.2628 Shrinkage
ユーザー Yu_212Yu_212
提出日時 2024-02-16 21:37:48
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 787 bytes
コンパイル時間 2,626 ms
コンパイル使用メモリ 245,240 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2024-02-16 21:37:56
合計ジャッジ時間 3,701 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 AC 2 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 2 ms
6,548 KB
testcase_11 AC 2 ms
6,548 KB
testcase_12 AC 2 ms
6,548 KB
testcase_13 AC 2 ms
6,548 KB
testcase_14 AC 2 ms
6,548 KB
testcase_15 AC 2 ms
6,548 KB
testcase_16 AC 2 ms
6,548 KB
testcase_17 AC 3 ms
6,548 KB
testcase_18 AC 3 ms
6,548 KB
testcase_19 AC 2 ms
6,548 KB
testcase_20 AC 2 ms
6,548 KB
testcase_21 AC 2 ms
6,548 KB
testcase_22 AC 2 ms
6,548 KB
testcase_23 AC 2 ms
6,548 KB
testcase_24 AC 2 ms
6,548 KB
testcase_25 AC 2 ms
6,548 KB
testcase_26 AC 4 ms
6,548 KB
testcase_27 AC 2 ms
6,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using i64 = long long;
#define var auto

int main() {
    cin.tie(0)->sync_with_stdio(false);
    int t;
    cin >> t;
    while (t --> 0) {
        ll x1, y1, x2, y2, gx1, gy1, gx2, gy2;
        cin >> x1 >> y1 >> x2 >> y2 >> gx1 >> gy1 >> gx2 >> gy2;
        bool ok = x1 == gx1 && y1 == gy1 && x2 == gx2 && y2 == gy2;
        x1 -= x2;
        y1 -= y2;
        gx1 -= gx2;
        gy1 -= gy2;
        if (x1 < 0) {
            x1 *= -1;
            gx1 *= -1;
        }
        if (y1 < 0) {
            y1 *= -1;
            gy1 *= -1;
        }
        ok |= x1 * gy1 == y1 * gx1 && 0 <= gx1 && gx1 <= x1 && 0 <= gy1 && gy1 <= y1 && !(gx1 == x1 && gy1 == y1);
        cout << (ok ? "Yes" : "No") << endl;
    }
}
0