結果
| 問題 |
No.306 さいたま2008
|
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2015-11-27 22:46:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,011 bytes |
| コンパイル時間 | 905 ms |
| コンパイル使用メモリ | 97,132 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-14 00:10:22 |
| 合計ジャッジ時間 | 1,709 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 2 |
ソースコード
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
#include<unordered_set>
using namespace std;
double xa;
double ya;
double xb;
double yb;
double f(double y) {
return sqrt(xa*xa + (ya - y)*(ya - y)) + sqrt(xb*xb + (yb - y)*(yb - y));
}
int main() {
cin >> xa >> ya >> xb >> yb;
double mint = 0;
double maxt = 1145141919;
while ((maxt-mint)>0.0000001&&clock()/(double)(CLOCKS_PER_SEC)<1.5) {
double sa = maxt - mint;
sa /= 3.0;
double mid1 = mint + sa;
double mid2 = mid1 + sa;
if (f(mid1) > f(mid2)) {
mint = mid1;
}
else {
maxt = mid2;
}
}
printf("%.7f\n", mint);
return 0;
}
Kmcode1