网络赛前10奖励计蒜客的本子或鼠标垫(外校也可以来现场领取)
Xidian Online Judge WebBoard
[ New Thread ]
Problem 1002 >> 又交不上去了
14030199016 @ 2015-04-20 16:48:15
[ Quote ] [ Edit ] [ Delete ] 1#
服务器未收到数据……这是傲娇啊喂!看来还需要好好地调教她~~~
xry111 @ 2015-04-20 23:14:14
[ Quote ] [ Edit ] [ Delete ] 2#
This is beacuse of XDU servers room firewall. Fpcsong is contacting the admin of it.
1301120533 @ 2015-06-27 15:36:54
[ Quote ] [ Edit ] [ Delete ] 3#
我的程序居然因为int sum[102][102][102];这句话而运行出现段错误,小伙伴们帮忙看看这是什么原因啊,好诡异啊
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void)
{
int n,x,y,z,t;
int ix,iy,iz;


int sumx,sumy,sumz,max;
int sum[102][102][102];
while(EOF!=scanf("%d%d%d%d%d",&n,&x,&y,&z,&t))
{

max=0;
sum[0][0][0]=0;
for(ix=0; ix<=n; ix++)
for(iy=0; iy<=n-ix; iy++)
for(iz=0; iz<=n-ix-iy; iz++)
{
if(ix==0)
sumx=0;
else
sumx=sum[ix-1][iy][iz]+(t+(iz)*z)*(x+iy*y);
if(iy==0)
sumy=0;
else
sumy=sum[ix][iy-1][iz]+(t+(iz)*z)*(iy-1)*y;
if(iz==0)
sumz=0;
else
sumz=sum[ix][iy][iz-1]+(t+(iz-1)*z)*iy*y;
sum[ix][iy][iz]=sumz>=(sumy>=sumx?sumy:sumx)?sumz:(sumy>=sumx?sumy:sumx);
if(sum[ix][iy][iz]>max)
max=sum[ix][iy][iz];
}
printf("%d\n",max);
}
return(0);
}
1301120533 @ 2015-06-27 17:55:29
[ Quote ] [ Edit ] [ Delete ] 4#
int sum[102][102][102];得放在全局区,栈空间放不下那么大的数据。
在VS中,这个默认空间大小是1M,显然,int sum[102][102][102];超出了默认栈大小
xry111 @ 2015-06-28 18:16:00
[ Quote ] [ Edit ] [ Delete ] 5#
@110
I think we should post following information on the homepage:
uname -a
ulimit -a
gcc -v
java -version
fpc -version
[Top] [Previous Page] [Next Page]
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2014 Xidian ACM Online Judge TEAM
GPL2.0 2003-2014 HUSTOJ Project TEAM