結果

問題 No.3180 angles sum
ユーザー SnowBeenDiding
提出日時 2025-06-13 21:47:58
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 2,028 bytes
コンパイル時間 5,366 ms
コンパイル使用メモリ 335,304 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-14 01:40:49
合計ジャッジ時間 8,776 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;

typedef long long ll;

using mint = modint998244353;

struct fraction {
    ll p, q;
    fraction(ll P = 0, ll Q = 1) : p(P), q(Q) {}

    bool operator<(const fraction &other) const {
        return p * other.q < other.p * q;
    }
    bool operator<=(const fraction &other) const {
        return p * other.q <= other.p * q;
    }
    bool operator>(const fraction &other) const {
        return p * other.q > other.p * q;
    }
    bool operator>=(const fraction &other) const {
        return p * other.q >= other.p * q;
    }
    bool operator==(const fraction &other) const {
        return p * other.q == other.p * q;
    }

    fraction operator+(const fraction &other) const {
        return fraction(p * other.q + other.p * q, q * other.q);
    }
    fraction operator-(const fraction &other) const {
        return fraction(p * other.q - other.p * q, q * other.q);
    }
    fraction operator*(const fraction &other) const {
        return fraction(p * other.p, q * other.q);
    }
    fraction operator/(const fraction &other) const {
        return fraction(p * other.q, q * other.p);
    }
    fraction operator+=(const fraction &other) { return *this = *this + other; }
    fraction operator-=(const fraction &other) { return *this = *this - other; }
    fraction operator*=(const fraction &other) { return *this = *this * other; }
    fraction operator/=(const fraction &other) { return *this = *this / other; }
};

fraction input() {
    ll x, y;
    cin >> x >> y;
    fraction ret(y, x);
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(12);
    int t;
    cin >> t;
    fraction one(1, 1);
    while (t--) {
        auto A = input();
        auto B = input();
        auto C = input();
        bool ok = (A * B * C) == (C - A - B);
        cout << (ok ? "Yes\n" : "No\n");
    }
}
0