poj 1177
http://acm.pku.edu.cn/JudgeOnline/problem?id=1177
求N 个矩形并的边的周长。用离散话通过了,还不知道如果用线段树做,在学习中ing , 发现自己好菜。
#include "iostream"
#include "cstdlib"
#include "cstdio"
#include "algorithm"
using namespace std;
const int MaxN = 5010;
int X[MaxN << 1], Y[MaxN << 1];
int XX[MaxN << 1], YY[MaxN << 1];
int x1,x2,y1,y2;
int N;
typedef struct superSeg{
int x1,x2,y;
bool ceil;
void insert(int _x1,int _x2,int _y, bool _ce......
阅读全文