結果
| 問題 | 
                            No.2555 Intriguing Triangle
                             | 
                    
| コンテスト | |
| ユーザー | 
                             momoyuu
                         | 
                    
| 提出日時 | 2023-12-03 00:28:40 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,005 bytes | 
| コンパイル時間 | 1,151 ms | 
| コンパイル使用メモリ | 107,656 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-26 21:50:05 | 
| 合計ジャッジ時間 | 2,352 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 12 WA * 16 | 
ソースコード
#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
using ll = long long;
#include<math.h>
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin>>a>>b>>c;
    
    const int mx = 200;
    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;
                cout<<i<<" "<<j<<endl;
            }
        }
    }
    if(fn) cout<<"Yes\n";
    else cout<<"No\n";
}
            
            
            
        
            
momoyuu