-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11494-Queen.cpp
72 lines (59 loc) · 1.85 KB
/
11494-Queen.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* FILE: Queen-11494.cpp
*
* @author: Md. Arafat Hasan Jenin <opendoor.Arafat<at>gmail<dot>com>
*
* LINK:
*
* Description:
*
* DEVELOPMENT HISTORY:
* Date Change Version Description
* --------------------------------------------------------------
* 02 Mar 2017 New 1.0 AC
*
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <climits>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#define FileIn(file) freopen("input.txt", "r", stdin)
#define FileOut(file) freopen("output.txt", "w", stdout)
#define FOR(i, a, b) for (int i=a; i<=b; i++)
#define ROF(i, b, a) for (int i=b; i>=a; i--)
#define REP(i, n) for (int i=0; i<n; i++)
#define Fill(ar, val) memset(ar, val, sizeof(ar))
#define uint64 unsigned long long
#define all(ar) ar.begin(), ar.end()
#define pb push_back
/*****************____________BIT_OPERATIONS____________****************/
#define bit(n) (1 << (n)) //2^n
//check ith bit of integer n, 0 or 1
#define bitchk(n, i) ((n & (1 << i))? 1 : 0)
#define bit_on(n, i) (n | (1 << i)) //set ith bit ON of the integer n
#define bit_off(n, i) (n & ~(1 << i)) //set ith bit OFF of the intger n
//toggle ith bit of integer n, set 0 if 1, set 1 if 0
#define bit_toggle(n, i) (n ^ ( 1 << i))
//set ith bit to x (x is bool, 1 or 0) of the integer n
#define bit_setx(n, x, i) (n ^ ((-x ^ n) & (1 << i)))
#define nl cout << endl;
#define lck cout << "______________" << endl;
typedef long long ll;
using namespace std;
int main() {
int x1, y1, x2, y2;
while(cin >> x1 >> y1 >> x2 >> y2 && x1 && y1 && x2 && y2){
if((x1==x2&&y1==y2))
cout << 0 << endl;
else if((x1==x2||y1==y2)||(x1-x2==y1-y2)||(x1-x2==-(y1-y2)))
cout << 1 << endl;
else cout << 2 << endl;
}
return 0;
}