We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5141de9 commit 58ff2faCopy full SHA for 58ff2fa
CodeForces/1772B. Matrix Rotation.cpp
@@ -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