| ||||||||||
| 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 | |||||||||
为什么判断a[i]>a[i+1]和a[i]<a[i+1]即可??AC的,但不知道怎么证明
if(a[i] > a[i+1])
{
s = 1;
t ++;
for(j=i+1;j<=n;j++)
{
if( s==1&&a[i]<a[i+1] || s==0&&a[i]>a[i+1] )
{
t ++;
s^= 1;
}
}
if(t > max) max = t;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator