UVa221 - Urban Elevations

#include
#include
using namespace std;
const int maxn = 100 + 5;
struct Building{
    int id;
    double x,y,w,d,h;
    bool operator < (const Building& rhs) const {
        return x < rhs.x || ( x == rhs.x && y < rhs.y );
    }
}b[maxn];

int n;
double x[maxn*2];

bool cover(int i, double mx){
    return b[i].x <= mx && b[i].x + b[i].w >= mx;
}

bool visible(int i, double mx){
    if(!cover(i,mx)) return false;
    for(int k=0;k=b[i].h && cover(k, mx)) return false;
    }
    return true;
}

int main()
{
    int kase = 0;
    while(scanf("%d", &n)==1&&n){
        for(int i=0;i

你可能感兴趣的:(UVA)