結果

問題 No.360 増加門松列
ユーザー vjudge1
提出日時 2025-08-24 12:33:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,092 bytes
コンパイル時間 1,112 ms
コンパイル使用メモリ 163,720 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-08-24 12:33:52
合計ジャッジ時間 2,053 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <bits/stdc++.h>
# define FILE(x) freopen(x ".in", "r", stdin); freopen(x ".out", "w", stdout);
using namespace std;
const double e = 1e-12;
bool check(double a, double b, double c, double d)
{
    double minn = 0.0, maxx = 1e100;
    if (fabs(b) < e)
    {
        if (!(a > 0)) return 0;
    }
    else if (b > 0)
    {
        minn = max(minn, -a / b);
    }
    else
    {
        maxx = min(maxx, -a / b);
    }
    if (fabs(d) < e)
    {
        if (!(c > 0)) return 0;
    }
    else if (d > 0)
    {
        minn = max(minn, -c / d);
    }
    else
    {
        maxx = min(maxx, -c / d);
    }
    return minn + e < maxx;
    
}
void solve()
{
    double x1, x2, x3, y1, y2, y3;
    cin >> x1 >> x2 >> x3 >> y1 >> y2 >> y3;
    bool ans = 0;
    if (check(x2 - x1, y2 - y1, x2 - x3, y2 - y3) || check(- (x2 - x2), - (y2 - y1), - (x2 - x3), - (y2 - y3))) ans = 1;
    cout << (ans ? "YES" : "NO") << '\n';
}
int main()
{
    //FILE("bamboo");
    ios :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int T = 1;
    //cin >> T;
    while (T --) solve();
    return 0;
}
0