結果

問題 No.208 王将
ユーザー btk
提出日時 2015-05-15 22:41:12
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 753 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 86,464 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 04:07:52
合計ジャッジ時間 1,261 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<utility>
#include<complex>
#include<functional>
using namespace std;


#define LL long long
const long double eps = 1e6;
int main(void){

	LL x, y, a, b;
	cin >> x >> y >> a >> b;
	bool flag = false;
	auto d = sqrt((long double)x*x + y*y) - sqrt((long double)(x - a)*(x - a) - (y - b)*(y - b)) - (sqrt((long double)a*a + b*b));
	if (d<eps&&d>-eps)flag = true;
	if (x == 0 || y == 0)flag = false;
	if (abs(x) != abs(y))flag = false;
	cout << max(abs(x), abs(y)) + flag << endl;

	return(0);
}
0