結果

問題 No.2953 Maximum Right Triangle
ユーザー VvyLw
提出日時 2024-11-08 22:08:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 931 bytes
コンパイル時間 1,291 ms
コンパイル使用メモリ 103,632 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 22:08:51
合計ジャッジ時間 1,815 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#ifdef local
#include "debug_print.hpp"
#else
#define dump(...) void(0);
#endif

#include <iostream>
#include <ranges>
namespace man {
constexpr inline bool scope(const int l, const int x, const int r) noexcept { return l <= x && x <= r; }
inline int64_t solve() noexcept {
    using namespace std::views;
    int64_t d, x, y;
    std::cin >> d >> x >> y;
    const auto dist = x * x + y * y;
    const int nx = x - y, ny = y + x;
    const int mx = x + y, my = y - x;
    return (scope(0, nx, d) && scope(0, ny, d)) || (scope(0, mx, d) && scope(0, my, d)) ? dist : 0;
}
}
int main() {
    std::cin.tie(nullptr) -> sync_with_stdio(false);
    int t;
    std::cin >> t;
    for([[maybe_unused]] const auto _: std::views::iota(0, t)) {
        std::cout << man::solve() << '\n';
    }
}
0