結果
| 問題 |
No.306 さいたま2008
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-11-27 22:55:07 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 882 bytes |
| コンパイル時間 | 1,306 ms |
| コンパイル使用メモリ | 159,584 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 00:13:26 |
| 合計ジャッジ時間 | 2,161 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘Point get()’:
main.cpp:20:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
20 | scanf("%lf%lf",&x,&y);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
//#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
template<class T,class U>void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>void chmax(T &t,U f){if(t<f)t=f;}
typedef complex<double>Point;
Point get(){
double x,y;
scanf("%lf%lf",&x,&y);
return Point(x,y);
}
int main(){
Point A,B;
A=get();B=get();
double lb=0,ub=1000;
for(int i=0;i<1000;i++){
double m1=(lb*2+ub)/3,m2=(lb+ub*2)/3;
Point p1(0,m1),p2(0,m2);
double d1=abs(A-p1)+abs(B-p1);
double d2=abs(A-p2)+abs(B-p2);
if(d1+(1e-12)>d2)lb=m1;
else ub=m2;
}
printf("%.20lf\n",ub);
return 0;
}
latte0119