Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

why WA? 3Q

Posted by jnu051345 at 2007-09-23 20:21:40 on Problem 3250
#include<iostream.h>
#include<stdio.h>
#define max 100000
int main()
{
	unsigned long n,count=0,i,j;
	__int64 h[max];
	cin>>n;//读入牛的个数	
	count=0;
	for(i=1;i<n+1;i++)
	{
		scanf("%I64d",&h[i]);//每个牛的高度
	}
	for(i=1;i<n;i++)
	{
		j=i+1;
		while((h[i]>h[j])&&(j<=n))
		{
			count++;
			j++;
		}
	}
	printf("%u\n",count);
    return 0;
}


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator