= = =
dfoi吧
全部回复
仅看楼主
level 4
吴以伦3 楼主
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cctype>
#include<map>
using namespace std;
#define N 200010
typedef map<int,int>T;
typedef T::iterator Tp;
T a[N<<1];
int n;
inline int getint(){
int re;char ch;
while(!isdigit(ch=getchar()))if(ch<1){puts("99536");exit(0);}
re=ch-48;
while(isdigit(ch=getchar()))re=re*10+ch-48;
return re;
}vector<int>XX,YY;
struct rect{
int x1,x2,y1,y2;
inline void init(){
XX.push_back(x1=getint());
YY.push_back(y1=getint());
XX.push_back(x2=getint());
YY.push_back(y2=getint());
}inline void mark(){
x1=lower_bound(XX.begin(),XX.end(),x1)-XX.begin()+1;
y1=lower_bound(YY.begin(),YY.end(),y1)-YY.begin()+1;
x2=lower_bound(XX.begin(),XX.end(),x2)-XX.begin()+1;
y2=lower_bound(YY.begin(),YY.end(),y2)-YY.begin()+1;
}inline bool operator<(const rect&x)const{return x1<x.x1;}
}A[N];
inline int Q(int x,int X){
int ans=0;
for(;x;x-=x&-x){
Tp it=a[x].upper_bound(X);
if(it!=a[x].end())ans=max(ans,it->second);
}return ans;
}inline int I(int x,int X,int Y){
for(;x<=n<<1;x+=x&-x){
Tp it=a[x].upper_bound(X);
if(it->second>Y)continue;
a[x][X]=Y;
it=a[x].find(X);
while(it!=a[x].begin()){
Tp it2=it;
it2--;
if(it2->second<Y)a[x].erase(it2);
else break;
}
}
}int main(){
scanf("%d",&n);
for(int i=n;i--;)A[i].init();
sort(XX.begin(),XX.end());
sort(YY.begin(),YY.end());
for(int i=n;i--;)A[i].mark();
sort(A,A+n);
int ans=0;
for(int i=-1;++i!=n;){
ans+=Q(A[i].y1,A[i].x2)>A[i].y2;
I(A[i].y1,A[i].x2,A[i].y2);
}printf("%d\n",ans);
return 0;
}
2012年08月14日 07点08分 1
level 2
膜拜~~~
2012年08月14日 07点08分 2
level 5
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!
2012年08月14日 07点08分 3
level 10
[星星闪]你这货学pascal的 滚。。。。。。。
2012年08月14日 07点08分 4
level 11
ORZ.....
2012年08月14日 07点08分 5
level 11
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!

2012年08月14日 07点08分 7
level 3
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶!!!!!!!!!!

2012年08月14日 08点08分 8
level 7
别跟我说这是你写的。。你这学Pascal的货。。。
2012年08月14日 08点08分 9
level 2
骗经验骗经验骗经验 我来顶经验
2012年08月14日 09点08分 10
level 4
吴以伦3 楼主
f*ck
我没标称了= =诶
2012年08月14日 16点08分 12
level 10
吴以伦魂淡。。。。。。。
2012年08月15日 03点08分 13
1