結果

問題 No.2555 Intriguing Triangle
ユーザー coindarw
提出日時 2023-12-01 17:18:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,568 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 193,588 KB
最終ジャッジ日時 2025-02-18 03:00:30
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using ll = long long;
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; --i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define repc2(i, s, n) for (int i = (s); i <= (int)(n); i++)
constexpr int inf = 2000'000'000;
constexpr ll linf = 4000000000000000000ll;
constexpr ll M7 = 1000000007ll;
constexpr ll M09 = 1000000009ll;
constexpr ll M9 = 998244353ll;
#define all(v) begin(v), end(v)
#define rall(v) rbegin(v), rend(v)
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long double a, b, c;
    cin >> a >> b >> c;

    reps(x, 200) reps(y, 200) {
        if (x + y + a >= b + c) continue;
        auto cosB = ((x + y + a) * (x + y + a) + b * b - c * c) / (2 * b * (x + y + a));
        auto cosC = ((x + y + a) * (x + y + a) + c * c - b * b) / (2 * c * (x + y + a));
        auto s = sqrtl(b * b + x * x - 2 * b * x * cosB);
        auto t = sqrtl(c * c + y * y - 2 * c * y * cosC);

        auto cosP = (s * s + b * b - x * x) / (2 * s * b);
        auto cosQ = (t * t + c * c - y * y) / (2 * t * c);

        if (abs(cosP - cosQ) < 1e-9) {
            cout << "Yes\n";
            // cerr << x << " " << y << endl;
            return 0;
        } else {
            cerr << x << " " << y << " "
                 << "No" << endl;
        }
    }
    cout << "No\n";
    return 0;
}
0