結果
| 問題 | 
                            No.2953 Maximum Right Triangle
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-11-08 22:13:35 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 986 bytes | 
| コンパイル時間 | 6,215 ms | 
| コンパイル使用メモリ | 335,532 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-08 22:13:46 | 
| 合計ジャッジ時間 | 6,743 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 1 WA * 5 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace chrono;
random_device rnd;
mt19937 mt(rnd());
int RandInt(int a, int b) {
    return a + mt() % (b - a + 1);
}
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
int t;
int main(){
    cin>>t;
    while(t--){
        ll d,x,y;
        cin>>d>>x>>y;
        ll x2,y2;
        x2=x-y;
        y2=x+y;
        if(x2<0){
            x2=x+y;
            y2=y-x;
        }
        bool ok=true;
        //cerr<<x2<<" "<<y2<<" "<<(x2-x)*(-x)+(y2-y)*(-y)<<endl;
        //内積
        if((x2-x)*(-x)+(y2-y)*(-y)!=0)ok=false;
        if(!(0<=x2&&x2<=d&&0<=y2&&y2<=d))ok=false;
        //外積
        ll ans=abs(x2*y-y2*x);
        if(ok){
            cout<<ans<<endl;
        }else{
            cout<<0<<endl;
        }
    }
}