-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB_Card_Game.cpp
More file actions
41 lines (38 loc) · 804 Bytes
/
B_Card_Game.cpp
File metadata and controls
41 lines (38 loc) · 804 Bytes
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
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define input for(int &i:v) cin >> i;
void print(const vector<int>& v) {
for (int i : v) {
cout << i << " ";
}
cout << endl;
}
int f(int a, int b){
if(a>b) return 1;
if(a<b) return -1;
return 0;
}
int solve() {
int a,b,c,d;
cin >> a >> b >> c >> d;
int count=0;
if(f(a,c)+f(b,d)>0) count++;
if(f(a,d)+f(b,c)>0) count++;
if(f(b,c)+f(a,d)>0) count++;
if(f(b,d)+f(a,c)>0) count++;
return count;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
int i=0;
while (i<t) {
i++;
cout << solve() << endl;
}
}