結果
| 問題 |
No.208 王将
|
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-02-16 23:54:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 591 bytes |
| コンパイル時間 | 496 ms |
| コンパイル使用メモリ | 59,980 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 07:21:18 |
| 合計ジャッジ時間 | 1,275 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 6 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (int i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (int i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
int main() {
int x1, y1, x2, y2, ans;
cin >> x1 >> y1 >> x2 >> y2;
ans = max(abs(x1),abs(y1));
if (x1 == 0 && x2 == 0 && y1 < y2 || y1 == 0 && y2 == 0 && x1 < x2)
ans++;
else if (abs(x1) == abs(y1) && abs(x2) == abs(y2) && abs(x1) < abs(x2) && x1*x2 > 0 && y1*y2 > 0)
ans++;
cout << ans << endl;
return 0;
}
h_noson