Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:将你的程序加多一个变量In Reply To:Re:好心人看一下^^--Time limit咋办? Posted by:zqykiki at 2006-08-09 15:30:34 #include<iostream.h> int main() { long a[50000],b[50000],i,n,j,p,q; int c[50000]={0},t=0; while(1) { p=0,q=0; cin>>n; t++; if(n==0) break; for(i=0;i<n;i++) cin>>a[i]>>b[i]; for(i=0;i<n;i++) if(c[i]!=t) { for(j=i+1;j<n;j++) { if((a[j]>=a[i])&&(b[j]>=b[i])) { c[i]=t; break; } if((a[j]<=a[i])&&(b[j]<=b[i])) c[j]=t; } if(c[i]!=t) q++; } cout<<q<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator