| ||||||||||
| 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:郁闷死了!!!这题是不是有错啊!!!,请高手给我看一下我的算法问题出在哪 Posted by:lg8t4bysq8 at 2005-11-13 16:40:53 #include<iostream>
using namespace std;
int main()
{
int l,a[1010],c[1010],t,p;
cin>>l;
for(int x=0;x<l;x++)
c[x]=1;
for(int i=0;i<l;i++)
cin>>a[i];
for(int m=0;m<l;m++)
{
for(int y=m+1;y<l;y++)
{
p=1;
t=a[m];
for(int n=y;n<l;n++)
if(a[n]>t)
{
p++;
t=a[n];
}
if(p>c[m]) c[m]=p;
}
}
t=c[0];
for(m=1;m<l;m++)
if(c[m]>t)
t=c[m];
cout<<t<<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