Friday, February 18, 2011

11764 - Jumping Mario


#include<stdio.h>

int main()
{
    register int t,n,a,b,h,l,i,j;
    //freopen("in.txt","r",stdin);

    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
        scanf("%d%d",&n,&a);
        h=l=0;

        for(j=1;j<n;j++)
        {
            scanf("%d",&b);
            if(!(a^b))continue;

            if(a<b)
                h++;
            else
                l++;
            a=b;
        }
        printf("Case %d: %d %d\n",i,h,l);
    }
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.