A题逗比了,没有看到All ai are distinct. All bi are distinct. 其实很水的。。
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 using namespace std; 6 7 #define mnx 100002 8 9 10 struct latop{ 11 int p, q; 12 bool operator < ( const latop & b ) const { 13 return p < b.p; 14 } 15 }a[mnx]; 16 int main(){ 17 int n; 18 scanf( "%d", &n ); 19 for( int i = 0; i < n; i++ ){ 20 scanf( "%d %d", &a[i].p, &a[i].q ); 21 } 22 sort( a, a + n ); 23 bool flag = 0; 24 for( int i = 1; i < n; i++ ){ 25 if( a[i].q < a[i-1].q ) flag = 1; 26 } 27 if( flag ) puts( "Happy Alex" ); 28 else puts( "Poor Alex" ); 29 return 0; 30 }