| ||||||||||
| 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 | |||||||||
请高手帮个忙,告诉我为什么是RE?我的程序在自己的机器上编译调试都没有问题,但是提交却是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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator