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 |
为什么会超时?#include<iostream.h> int main() { int n; while(cin>>n&&n!=0) { int (*a)[2]=new int[n][2]; for(int i=0;i<n;i++) { cin>>a[i][0]>>a[i][1]; } int s=0; for(i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if(a[i][0]<a[j][0]&&a[i][1]<a[j][1]) { s++; break; } } } cout<<s<<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