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

请高手帮个忙,告诉我为什么是RE?

Posted by whus200531200055 at 2007-01-02 20:21:00 on Problem 1163
我的程序在自己的机器上编译调试都没有问题,但是提交却是RE,请高手们帮忙看看,谢谢了!
#include<iostream.h>
int add(int t)
{
	int a=0;
	while(t>0){a=a+t;t--;}
	return a;
}
void main(void)
{
	int num,sum,temp;
	int *p;
	temp=0;
	cin>>num;
	sum=add(num);
	p=new int[sum];
	while(temp<sum)
	{
		cin>>p[temp];
		temp++;
	}
	while(num>1)
	{
		int work,last;
		work=num-1;
		last=num-2;
		work=add(work);
		last=add(last);
		for(temp=0;temp<work;temp++)
		{
			p[last+temp]+=p[work+temp]>p[work+temp+1]?p[work+temp]:p[work+temp+1];
		}
		num--;
	}
	cout<<p[0]<<endl;
	delete []p;
}

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