摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1171我错在这里把int c1[max];int c2[max];int value[51];int count[51];放在main函数里面,结果导致stack overflow 栈溢出,但放在main函数外面作为全局变量就不会。这是因为函数的内存在开在栈上的,全局变量内存在堆上分配。前者远小于后者View Code 1 #include<cstdio> 2 #include<cstring> 3 4 #define max 250010 5 6 int c1[max]; 7 int
阅读全文
posted @ 2012-08-11 16:44
浙公网安备 33010602011771号