結果
問題 | No.2953 Maximum Right Triangle |
ユーザー |
|
提出日時 | 2024-11-16 09:53:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 444 bytes |
コンパイル時間 | 1,625 ms |
コンパイル使用メモリ | 166,180 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-16 09:53:20 |
合計ジャッジ時間 | 2,107 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 6 |
ソースコード
#include <bits/stdc++.h>using namespace std;int t, d, x, y, i, xx, yy, a, b;int main() {cin >> t;while (t--) {i = 1;cin >> d >> x >> y;a = x * x + y * y;xx = x;yy = y;while (xx - i * y >= 0 && yy + i * x <= d) i++;i--;b = (x - (xx - i * y)) * (x - (xx - i * y));b += (yy + i * x - y) * (yy + i * x - y);cout << sqrt(a*b) << '\n';}}