結果
| 問題 | No.2555 Intriguing Triangle | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-12-02 00:04:44 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 616 bytes | 
| コンパイル時間 | 1,876 ms | 
| コンパイル使用メモリ | 192,252 KB | 
| 最終ジャッジ日時 | 2025-02-18 03:05:59 | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 22 WA * 6 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |     scanf("%d%d%d", &a, &b, &c);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <bits/stdc++.h>
#define EPS 1e-9
using namespace std;
int a, b, c;
double gao(int t, int b, int c, int i) {
    double cosC = (t * t + b * b - c * c) / (2.0 * t * b);
    double C = sqrt(b * b + i * i - 2 * b * i * cosC);
    return (b * b + C * C - i * i) / (2.0 * b * C);
}
bool check(int t) {
    for (int i = 1, j = t - a - 1; j > 0; i++, j--)
        if (fabs(gao(t, b, c, i) - gao(t, c, b, j)) < EPS) return true;
    return false;
}
int main() {
    scanf("%d%d%d", &a, &b, &c);
    for (int i = a + 2; i < b + c; i++) if (check(i)) { printf("Yes\n"); return 0; }
    printf("No\n"); return 0;
}
            
            
            
        