标签:row each == while tput family class connect ios
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 3228 Accepted Submission(s): 613
1 #include<bits/stdc++.h> 2 using namespace std; 3 int x_1[5],y_1[5],x_2[5],y_2[5]; 4 int main(){ 5 int t,a,b; 6 ios::sync_with_stdio(0); 7 cin>>t; 8 while(t--){ 9 for(int i=0;i<=1;i++)cin>>x_1[i]>>y_1[i]>>x_2[i]>>y_2[i]; 10 a=0,b=1; 11 if(x_1[0]>x_1[1])a^=1,b^=1; 12 if(x_1[0]==x_1[1]){ 13 if(x_2[b]>x_2[a]||y_2[b]>y_2[a]||y_1[b]<y_1[a])a^=1,b^=1; 14 } 15 if(x_1[a]==x_1[b]&&x_2[a]==x_2[b]&&y_1[a]==y_1[b]&&y_2[a]==y_2[b]){ 16 cout<<2<<endl; 17 } 18 else{ 19 if(x_2[a]<=x_1[b]){ 20 cout<<3<<endl; 21 } 22 else{ 23 if(y_2[a]<=y_1[b]||y_1[a]>=y_2[b]){ 24 cout<<3<<endl; 25 } 26 else{ 27 if(x_1[a]==x_1[b]){ ///l1 28 if(x_2[a]==x_2[b]){ ///r1 29 if(y_1[a]==y_1[b]){ ///d1 30 if(y_2[a]==y_2[b]) ///u1 31 cout<<2<<endl; 32 else 33 cout<<3<<endl; 34 } 35 else{ ///d0 36 if(y_2[a]==y_2[b]) ///u1 37 cout<<3<<endl; 38 else ///u0 39 cout<<4<<endl; 40 } 41 } 42 else if(x_2[b]>x_2[a]){ ///l1 r0 43 if(y_1[a]==y_1[b]){ ///d1 44 if(y_2[a]==y_2[b]||y_2[a]<y_2[b]) 45 cout<<3<<endl; 46 else if(y_2[a]>y_2[b]) 47 cout<<4<<endl; 48 } 49 else{ ///d0 50 if(y_1[a]<y_1[b]){ 51 if(y_2[a]==y_2[b])cout<<4<<endl; 52 else if(y_2[a]>y_2[b]) cout<<5<<endl; 53 else cout<<4<<endl; 54 } 55 else{ 56 if(y_2[a]==y_2[b])cout<<3<<endl; 57 else if(y_2[a]>y_2[b]) cout<<4<<endl; 58 else cout<<3<<endl; 59 } 60 } 61 } 62 else{ 63 if(y_1[a]==y_1[b]){ ///d1 64 if(y_2[a]==y_2[b]||y_2[a]>y_2[b]) 65 cout<<3<<endl; 66 else if(y_2[a]<y_2[b]) 67 cout<<4<<endl; 68 } 69 else{ ///d0 70 if(y_1[a]>y_1[b]){ 71 if(y_2[a]==y_2[b])cout<<4<<endl; 72 else if(y_2[a]>y_2[b]) cout<<4<<endl; 73 else cout<<5<<endl; 74 } 75 else{ 76 if(y_2[a]==y_2[b])cout<<3<<endl; 77 else if(y_2[a]>y_2[b]) cout<<3<<endl; 78 else cout<<4<<endl; 79 } 80 } 81 } 82 } 83 else{ 84 if(x_2[a]==x_2[b]){ ///l0 r1 85 if(y_1[a]==y_1[b]){ 86 if(y_2[a]==y_2[b]) 87 cout<<3<<endl; 88 else if(y_2[a]>y_2[b])cout<<3<<endl; 89 else cout<<4<<endl; 90 } 91 else{ 92 if(y_1[a]<y_1[b]){ 93 if(y_2[a]==y_2[b]||y_2[a]>y_2[b])cout<<3<<endl; 94 else cout<<4<<endl; 95 } 96 else{ 97 if(y_2[a]==y_2[b]||y_2[a]>y_2[b])cout<<4<<endl; 98 else cout<<5<<endl; 99 } 100 } 101 } 102 else{ 103 if(x_2[a]>x_2[b]){ 104 if(y_1[a]==y_1[b]){ 105 if(y_2[a]==y_2[b])cout<<4<<endl; 106 else if(y_2[a]>y_2[b])cout<<3<<endl; 107 else cout<<5<<endl; 108 } 109 else{ 110 if(y_1[a]<y_1[b]){ 111 if(y_2[a]==y_2[b]||y_2[a]>y_2[b])cout<<3<<endl; 112 else cout<<4<<endl; 113 } 114 else{ 115 if(y_2[a]==y_2[b])cout<<5<<endl; 116 else if(y_2[a]>y_2[b])cout<<4<<endl; 117 else cout<<6<<endl; 118 } 119 } 120 } 121 else{ 122 if(y_1[a]==y_1[b]){ 123 cout<<4<<endl; 124 } 125 else{ 126 if(y_1[a]<y_1[b]){ 127 cout<<4<<endl; 128 } 129 else{ 130 if(y_2[a]==y_2[b]||y_2[a]>y_2[b])cout<<4<<endl; 131 else cout<<4<<endl; 132 } 133 } 134 } 135 } 136 } 137 } 138 } 139 } 140 } 141 142 }
[枚举] HDU 2019 Multi-University Training Contest 8 - Calabash and Landlord
标签:row each == while tput family class connect ios
原文地址:https://www.cnblogs.com/Railgun000/p/11360917.html