結果
問題 |
No.735 接線
|
ユーザー |
|
提出日時 | 2023-10-29 17:34:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 472 bytes |
コンパイル時間 | 1,893 ms |
コンパイル使用メモリ | 166,820 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 16:49:05 |
合計ジャッジ時間 | 2,458 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 WA * 2 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i<n; ++i) #define repl(i,m,n) for(ll i=m; i<n; ++i) bool check(double r, double d, double x){ return d*d - r*r > x*x; } int main(){ double r, d; cin >> r >> d; double ok = 0.0, ng = 1e5; rep(i, 0, 100){ double ce = (ok + ng)/2.0; if(check(r, d, ce)) ok = ce; else ng = ce; } printf("%.12f\n", ok); return 0; }