-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacm32.cpp
More file actions
75 lines (70 loc) · 1.1 KB
/
acm32.cpp
File metadata and controls
75 lines (70 loc) · 1.1 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
vector<int> a[3],temp;
int big1=0,big2=0,big3=0,x;
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
{
cin>>x;
a[i].push_back(x);
}
for(int j=0;j<2;j++)
for(int i=0;i<2-j;i++)
{
if(a[i][0]<a[i+1][0])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
cout<<a[i][j]<<" ";
}
cout<<endl;
}
if(a[0][1]>=a[1][1]&&a[0][2]>=a[1][2])
if(a[1][1]>=a[2][1]&&a[1][2]>=a[2][2])
big1=1;
for(int j=0;j<2;j++)
for(int i=0;i<2-j;i++)
{
if(a[i][1]<a[i+1][1])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
if(a[0][0]>=a[1][0]&&a[0][2]>=a[1][2])
if(a[1][0]>=a[2][0]&&a[1][2]>=a[2][2])
big2=1;
for(int j=0;j<2;j++)
for(int i=0;i<2-j;i++)
{
if(a[i][2]<a[i+1][2])
{
temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
}
}
if(a[0][1]>=a[1][1]&&a[0][0]>=a[1][0])
if(a[1][1]>=a[2][1]&&a[1][0]>=a[2][0])
big3=1;
if(big1==0||big2==0||big3==0)
cout<<"no\n";
else
cout<<"yes\n";
}
return 0;
}