luogu P1003 carpet

 1 #include <iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     int n,x,y;
 6     int x1[11000],y1[11000],lx[11000],ly[11000];
 7     cin >> n;
 8     for (int i = 1;i <= n;i++)
 9         cin >> x1[i] >> y1[i] >> lx[i] >> ly[i];
10     cin >> x >> y;
11     for (int= n-I; I> = . 1 ; i-- )
 12 is      {
 13 is          IF ((X1 [I] <&& X = X <= X1 [I] + LX [I]) && (Y1 [I] <= Y && Y <Y1 = [I] + LY [I]))
 14          {
 15              COUT I << << endl;
 16              return  0 ;
 . 17          }
 18 is      }
 . 19      // if this location does not end the program 
20 is      COUT << - . 1 << endl; 
 21 is      return  0 ;
 22 is }

 

Guess you like

Origin www.cnblogs.com/iat14/p/11246999.html
Recommended