結果
| 問題 |
No.3180 angles sum
|
| コンテスト | |
| ユーザー |
SnowBeenDiding
|
| 提出日時 | 2025-08-14 22:14:36 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 171 ms / 2,000 ms |
| コード長 | 2,250 bytes |
| コンパイル時間 | 6,851 ms |
| コンパイル使用メモリ | 332,564 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-08-14 22:14:47 |
| 合計ジャッジ時間 | 10,241 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
#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;
const double eps = 1e-5;
while (t--) {
auto A = input();
auto B = input();
auto C = input();
bool ok = (A * B * C) == (C - A - B);
double arctana = atan2(A.p, A.q);
double arctanb = atan2(B.p, B.q);
double arctanc = atan2(C.p, C.q);
if (abs(arctanc - (arctana + arctanb)) > eps) {
ok = false;
}
cout << (ok ? "Yes\n" : "No\n");
}
}
SnowBeenDiding