| ||||||||||
| 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.h>
int main(void){
int i, j, tmp, n, a, b, sub;
while(cin >> n){
a = 0; b = 0; sub = 0; tmp = 0; i = n-1; j = n-1;
if(n < 1) goto L;
if(n ==1){
cin >> a;
goto L;
}
while(n--){
cin >> b;
if(b < a || n == 0){
if( n == 0) tmp = i - n;
else tmp = i-n-1;
if(tmp > sub) sub = tmp;
i = n;
}
if(n!=0)a = b;
else{
if(a >= b && sub == 1) sub = 0;
}
}
L: if( sub == 0) cout << -1 << endl;
else cout << sub << 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