結果

問題 No.2555 Intriguing Triangle
ユーザー RubikunRubikun
提出日時 2023-12-01 00:10:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,318 bytes
コンパイル時間 2,331 ms
コンパイル使用メモリ 202,424 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-12-01 13:37:42
合計ジャッジ時間 2,942 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 AC 3 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 3 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
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 3 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 AC 2 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll a,b,c;cin>>a>>b>>c;
    for(ll x=1;x<=100;x++){
        for(ll y=1;y<=100;y++){
            ll s=b,t=c,u=x+a+y;
            if(s+t>u&&t+u>s&&u+s>t){
                double tt=acos((double)(t*t+u*u-s*s)/(2.0*u*t)),ss=acos((double)(u*u+s*s-t*t)/(2.0*u*s));
                
                //cout<<ss<<" "<<tt<<endl;
                double da=sqrt(x*x+b*b-2.0*x*b*cos(ss)),ea=sqrt(y*y+c*c-2.0*y*c*cos(tt));
                
                double p=acos((da*da+b*b-x*x)/(2.0*da*b)),q=acos((ea*ea+c*c-y*y)/(2.0*ea*c));
                
                //cout<<p<<" "<<q<<endl;
                if(abs(p-q)<1e-8){
                    cout<<"Yes\n";
                    return 0;
                }
            }
        }
    }
    
    cout<<"No\n";
}

0