Casting unsigned int to signed int reduces stack memory usage, but why?

Правка en1, от accidentallygivenfuck, 2015-07-04 16:34:02

Today, I was checking the official solution for problem grassplant of USACO 2011 December Contest. I ran the solution on 12th test and it gave me runtime error (segmentation fault). I realized it was caused by stack overflow. Then (somewhy) I added (int) before E[u].size() in the function hang() and ran it on 12th test again. Surprisingly, stack did not overflow this time.

Can anyone who gets this stuff tell why this happens?

Теги stack memory, grassplant, usaco

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский accidentallygivenfuck 2015-07-04 16:39:41 159 Edit the post xD
en1 Английский accidentallygivenfuck 2015-07-04 16:34:02 611 Initial revision (published)