結果

問題 No.208 王将
ユーザー kurenai3110
提出日時 2016-11-08 17:23:40
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 56,256 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 04:52:57
合計ジャッジ時間 1,201 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;

int main()
{
	int x, y, x2, y2; cin >> x >> y >> x2 >> y2;
	bool flag = true;
	if (x > 0)if (x2 < 0)flag = false;
	else if (x < 0)if (x2>0)flag = false;
	if (y>0)if (y2 < 0)flag = false;
	else if (y < 0) if (y2>0)flag = false;
	cout << max(abs(x),abs(y)) + (abs(x2)==abs(y2)&&flag)<< endl;

	return 0;
}
0