USACO:Shaping Regions

#include
#include
#include
#include
#include
#define mp make_pair
using namespace std;
typedef long long lng;
typedef pair pii;
struct seg
{
  int l,r;
  seg(){}
  seg(int x,int y){l=x,r=y;}
};
int Min(int x,int y){if(xy) return x;return y;}
struct rec
{
  seg w,h;
  int col;
  rec(){}
  rec(seg x,seg y,int cc){w=x,h=y,col=cc;}
};
bool is_1(seg x,seg y)
{
    return x.l<=y.l?y.l c,now;
void f(rec x,rec &y) //x changed
{
    if(is_2(x,y))
    {
        seg w1=seek_insect(x.w,y.w),h1=seek_insect(x.h,y.h);
      if(w1.l>x.w.l){c.push_back(rec(seg(x.w.l,w1.l),x.h,x.col));}
      if(w1.rx.h.l){c.push_back(rec(w1,seg(x.h.l,h1.l),x.col));}
      if(h1.r

你可能感兴趣的:(usaco)