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 |
测试了各种数据都对,一个的情况也考虑了 为啥WA?#include<iostream> using namespace std; int main() { int a[10001][2]; int t,i,j,max; int no; no=1; a[0][0]=35000; a[0][1]=0; a[1][1]=1; cin>>a[1][0]; L: for(i=2;i<10001;i++) { cin>>a[i][0]; if(a[i][0]==-1) break; } max=1; for(t=2;t<i;t++) { for(j=t-1;j>=0;j--) if(a[t][0]<=a[j][0]) break; a[t][1]=a[j][1]+1; if(a[t][1]>max) max=a[t][1]; } cout<<"Test #"<<no<<endl<<" "<<"maximum possible interceptions: "<<max<<endl<<endl; no++; cin>>a[1][0]; if(a[1][0]!=-1) goto L; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator