Skip to content

Commit 58ff2fa

Browse files
authored
Create 1772B. Matrix Rotation.cpp
1 parent 5141de9 commit 58ff2fa

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

CodeForces/1772B. Matrix Rotation.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
int g[2][2];
6+
7+
void rotate() {
8+
int tmp = g[0][0];
9+
g[0][0] = g[1][0];
10+
g[1][0] = g[1][1];
11+
g[1][1] = g[0][1];
12+
g[0][1] = tmp;
13+
}
14+
15+
bool check() {
16+
return g[0][0] < g[0][1] && g[1][0] < g[1][1] && g[0][0] < g[1][0] && g[0][1] < g[1][1];
17+
}
18+
19+
int main() {
20+
int t;
21+
cin >> t;
22+
23+
while(t-- != 0) {
24+
cin >> g[0][0] >> g[0][1] >> g[1][0] >> g[1][1];
25+
26+
bool ok = false;
27+
28+
for(int i = 0; i < 5; ++i) {
29+
if(check()) {
30+
ok = true;
31+
break;
32+
}
33+
34+
rotate();
35+
}
36+
37+
if(ok) {
38+
puts("YES");
39+
} else {
40+
puts("NO");
41+
}
42+
}
43+
44+
return 0;
45+
}

0 commit comments

Comments
 (0)