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

能帮我看看我的程序错在哪吗?

Posted by zerocool_08 at 2005-07-18 13:59:49 on Problem 2352
#include "stdio.h"
#define max 32000
void	main(void)
{
	short	tr[max*3]={0};
	short	level[15001]={0};
	int		i,j,x,y,num,total;
	scanf("%d",&num);
	for(i=0;i<num;i++)
	{
		scanf("%d%d",&x,&y);
		for(j=32767+x,total=tr[j],tr[j]++;j>1;j/=2)
		{	//32767是15层的总节点数,第16层放横坐标,
			if(j%2)		
				total+=tr[j/2];											
			else
				tr[j/2]++;
		}
		level[total]++;
	}
	for(i=0;i<num;i++)
	printf("%d\n",level[i]);
}
	
	




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