forked from royalpranjal/Hackerrank
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareTheTriplets.cpp
More file actions
48 lines (41 loc) · 828 Bytes
/
Copy pathCompareTheTriplets.cpp
File metadata and controls
48 lines (41 loc) · 828 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
42
43
44
45
46
47
48
#include <bits/stdc++.h>
using namespace std;
vector < int > solve(int a0, int a1, int a2, int b0, int b1, int b2){
// Complete this function
vector<int> ans(2, 0);
if(a0 > b0){
ans[0]++;
}
else if(a0 < b0){
ans[1]++;
}
if(a1 > b1){
ans[0]++;
}
else if(a1 < b1){
ans[1]++;
}
if(a2 > b2){
ans[0]++;
}
else if(a2 < b2){
ans[1]++;
}
return ans;
}
int main() {
int a0;
int a1;
int a2;
cin >> a0 >> a1 >> a2;
int b0;
int b1;
int b2;
cin >> b0 >> b1 >> b2;
vector < int > result = solve(a0, a1, a2, b0, b1, b2);
for (ssize_t i = 0; i < result.size(); i++) {
cout << result[i] << (i != result.size() - 1 ? " " : "");
}
cout << endl;
return 0;
}