結果

問題 No.2555 Intriguing Triangle
ユーザー daiotadaiota
提出日時 2023-12-01 08:36:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 737 bytes
コンパイル時間 1,656 ms
コンパイル使用メモリ 167,848 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-01 13:41:54
合計ジャッジ時間 2,399 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)


double eps=1e-10;


int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	int i,j;

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


	for(j=max(a+1,abs(b-c));j<b+c;j++){
		if(b*b-c*c+j*j<=-2*b*j || b*b-c*c+j*j>=2*b*j) continue;
		for(i=1;i+a<j;i++){
			double cs=(b*b-c*c+j*j)/(2.0*b*j);
			double x=b*b+c*c-j*j+2.0*j*(i+a)-2.0*b*(i+a)*cs;
			double y=b*b-2.0*b*i*cs+i*i;
			double z=2.0*c*(b-i*cs);
			double u=b*b+(i+a)*(i+a)-2.0*b*(i+a)*cs;

			if(x*z<eps) continue;

			if(fabs(x*x*y-z*z*u)<eps){
				cout << "Yes" << endl;
				return 0;
			}

		}
	}


	cout << "No" << endl;



	return 0;
}
0