| ||||||||||
| 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 | |||||||||
为什么Output Limit Exceeded呢...附代码#include<stdio.h>
#include<string.h>
int main()
{
int i,n,tag,flag,stack[1000];
while(scanf("%d",&n)!=EOF&&n!=0)
{
while(scanf("%d",&stack[0]),stack[0]!=0)
{
memset(stack+1,0,sizeof(stack));
for(i=1;i<n;i++)
scanf("%d",&stack[i]);
tag=0,flag=0;
while(1)
{
for(i=tag;stack[i]<=stack[tag]&&i<n;i++)
{
if(stack[i]>stack[i-1]&&stack[i]<stack[tag])
{
flag=1;
break;
}
}
if(flag==1)
break;
if(i==n)
break;
tag=i;
}
if(flag==1)
printf("No\n");
else
printf("Yes\n");
}
printf("\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator