結果
| 問題 |
No.306 さいたま2008
|
| コンテスト | |
| ユーザー |
tetsuzuki1115
|
| 提出日時 | 2017-10-22 13:53:54 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,278 bytes |
| コンパイル時間 | 848 ms |
| コンパイル使用メモリ | 81,336 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-21 13:45:28 |
| 合計ジャッジ時間 | 1,535 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;
long long MOD = 1000000007;
int main() {
double X[12] = { 100, 10, 1, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001, 0.00000001, 0.000000001 };
double xa,ya,xb,yb;
cin >> xa >> ya >> xb >> yb;
double ans = 0;
for ( int i = 0; i < 12; i++ ) {
double dist;
double y;
dist = 1000000;
for ( int j = 0; j < 10; j++ ) {
double y1 = ans + X[i]*j;
double y2 = ans - X[i]*j;
double dist1 = sqrt( xa*xa + (ya-y1)*(ya-y1) ) + sqrt( xb*xb + (yb-y1)*(yb-y1) );
double dist2 = sqrt( xa*xa + (ya-y2)*(ya-y2) ) + sqrt( xb*xb + (yb-y2)*(yb-y2) );
if ( dist > dist1 ) {
dist = dist1;
y = y1;
}
if ( dist > dist2 ) {
dist = dist2;
y = y2;
}
}
ans = y;
}
printf( "%.9f", ans );
return 0;
}
tetsuzuki1115