結果
| 問題 |
No.208 王将
|
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2015-05-15 22:42:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 754 bytes |
| コンパイル時間 | 787 ms |
| コンパイル使用メモリ | 87,928 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-09 16:18:36 |
| 合計ジャッジ時間 | 1,696 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#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 = 1e-6;
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);
}
btk