結果
問題 | No.2555 Intriguing Triangle |
ユーザー | keisuke6 |
提出日時 | 2023-12-01 14:59:30 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 661 bytes |
コンパイル時間 | 2,364 ms |
コンパイル使用メモリ | 201,532 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-26 15:38:10 |
合計ジャッジ時間 | 3,208 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double double f(double a, double b, double c){ return (a*a-b*b-c*c)/(-2*b*c); } signed main(){ double a,b,c; cin>>a>>b>>c; for(int i=1;i<=200;i++)for(int j=1;j<=200;j++)if(2*max({a+i+j,b,c}) < a+i+j+b+c){ a = a+i+j; double x = (a*a+b*b-c*c)/(2*a); double y = sqrt(b*b-(a*a+b*b-c*c)*(a*a+b*b-c*c)/(4*a*a)); double n = f(i,sqrt(x*x+y*y),sqrt((x-i)*(x-i)+y*y)); double m = f(j,sqrt((a-x)*(a-x)+y*y),sqrt((a-j-x)*(a-j-x)+y*y)); double p = acos(n), q = acos(m); if(abs(p-q) <= 1e-8){ cout<<"Yes"<<endl; return 0; } a = a-i-j; } cout<<"No"<<endl; }