結果

問題 No.2555 Intriguing Triangle
ユーザー cho435cho435
提出日時 2023-12-02 13:00:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 1,996 ms
コンパイル使用メモリ 207,152 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-02 13:00:49
合計ジャッジ時間 3,279 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 3 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 1 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 1 ms
6,676 KB
testcase_21 AC 1 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 1 ms
6,676 KB
testcase_25 AC 1 ms
6,676 KB
testcase_26 AC 1 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int cmkt(vector<ll> v){
	sort(v.begin(),v.end());
	return v.at(0)+v.at(1)>v.at(2);
}

int main(){
	ll a,b,c;
	cin>>a>>b>>c;
	for(ll l=1;l<=100;l++){
		for(ll r=1;r<=100;r++){
			ll sa=l+a+r;
			if(!cmkt({sa,b,c})) continue;
			ll tmp1=(a*l*c-l*r*b+l*l*c)*c;
			ll tmp2=(a*r*b+r*r*b-l*r*c)*b;
			tmp1*=tmp1;
			tmp2*=tmp2;
			tmp1*=(2*b*sa)*(2*b*sa)-(b*b+sa*sa-c*c)*(b*b+sa*sa-c*c);
			tmp2*=(2*c*sa)*(2*c*sa)-(c*c+sa*sa-b*b)*(c*c+sa*sa-b*b);
			if(tmp1==tmp2){
				cout<<"Yes\n";
				return 0;
			}
		}
	}
	cout<<"No\n";
}
0