結果

問題 No.2555 Intriguing Triangle
ユーザー hiromi_ayasehiromi_ayase
提出日時 2023-12-07 05:01:52
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,072 bytes
コンパイル時間 5,360 ms
コンパイル使用メモリ 308,660 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-07 05:02:01
合計ジャッジ時間 7,478 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 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 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 WA -
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 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 2 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
using namespace std;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define FAST_IO                \
  ios::sync_with_stdio(false); \
  cin.tie(0);
const i64 INF = 1001001001001001001;
using Modint = atcoder::static_modint<998244353>;

int main() {
  FAST_IO
  auto ans = 0LL;

  int a,b,c;
  cin >> a >> b >> c;

  auto EPS = 1e-9;
  for (auto p = 1; p + a < b + c; p ++) {
    for (auto q = 1; p + q + a < b + c; q ++) {
      // triangle (b, c, p + q + a)
      auto d = p + q + a;
      auto cosB = (b * b + d * d - c * c) / (2.0 * b * d);
      auto cosC = (c * c + d * d - b * b) / (2.0 * c * d);

      auto ad = sqrt(b * b + p * p - 2 * b * p * cosB);
      auto ae = sqrt(c * c + q * q - 2 * c * q * cosC);

      auto cos1 = (ad * ad + b * b - p * p) / (2.0 * ad * b);
      auto cos2 = (ae * ae + c * c - q * q) / (2.0 * ae * c);

      if (abs(cos1 - cos2) < EPS) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }

  cout << "No" << endl;
}
0