結果

問題 No.2555 Intriguing Triangle
ユーザー coindarwcoindarw
提出日時 2023-12-01 17:18:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,568 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 201,788 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-01 17:18:59
合計ジャッジ時間 3,773 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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