結果
問題 | No.2555 Intriguing Triangle |
ユーザー |
![]() |
提出日時 | 2023-12-03 00:30:19 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 993 bytes |
コンパイル時間 | 1,067 ms |
コンパイル使用メモリ | 107,284 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 21:50:16 |
合計ジャッジ時間 | 1,876 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 |
ソースコード
#include<algorithm>#include<iostream>#include<vector>using namespace std;using ll = long long;#include<math.h>#define double long doubleint main(){cin.tie(nullptr);ios::sync_with_stdio(false);int a,b,c;cin>>a>>b>>c;const int mx = 300;bool fn = false;for(int i = 1;i<=mx;i++){for(int j = 1;j<=mx;j++){int all = a + i + j;if(b+c<=all) continue;if(b+all<=c) continue;if(c+all<=b) continue;double cb = (double)(b * b + all * all - c * c) / (2 * b * all);double cc = (double)(c*c+all*all-b*b)/(2*c*all);double ad = sqrt(b*b+i*i-2*b*i*cb);double ae = sqrt(c*c+j*j-2*c*j*cc);double a1 = (double)(b*b+ad*ad-i*i)/(2*b*ad);double a2 = (double)(c*c+ae*ae-j*j)/(2*c*ae);if(abs(a1-a2)<1e-9){fn = true;}}}if(fn) cout<<"Yes\n";else cout<<"No\n";}