-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdice-tower.cpp
43 lines (40 loc) · 1.09 KB
/
dice-tower.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
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n = 0;
cin >> n;
int topFace = 0;
cin >> topFace;
int leftFace = 0, rightFace = 0;
int opposingLeftFace = 0, opposingRightFace = 0, opposingTopFace = abs(7 - topFace);
vector<vector<int>> ParentVect;
for (int i = 0; i < n; ++i)
{
vector<int> vect;
cin >> leftFace >> rightFace;
opposingLeftFace = abs(7 - leftFace);
opposingRightFace = abs(7 - rightFace);
vect.push_back(leftFace);
vect.push_back(rightFace);
vect.push_back(opposingLeftFace);
vect.push_back(opposingRightFace);
vect.push_back(topFace);
vect.push_back(opposingTopFace);
sort(vect.begin(), vect.end());
vect.erase(unique(vect.begin(), vect.end()), vect.end());
ParentVect.push_back(vect);
}
bool correct = true;
for (int i = 0; i < ParentVect.size(); i++)
{
if (ParentVect[i].size() != 6)
correct = false;
}
if(correct){
cout << "YES";
} else {
cout << "NO";
}
return 0;
}