
-----------------------------------
smool
Tue Mar 05, 2013 9:41 pm

error: Not enough memory for dynamic array allocation
-----------------------------------
So I have the following code:


var n : int
get n
var primestemp : array 2 .. n of boolean


My problem is that when ever I enter 5000000, I get that error. It happens right at the start, right on the line 'var primestemp : array 2 .. n of boolean'. Is there any way around this? Or do I have use a linked list structure?
Please specify what version of Turing you are using
Open Turing

-----------------------------------
Insectoid
Tue Mar 05, 2013 10:19 pm

RE:error: Not enough memory for dynamic array allocation
-----------------------------------
The problem is simple. Turing can't allocate an array that big. Why would you need one anyway?

-----------------------------------
Raknarg
Wed Mar 06, 2013 7:59 pm

RE:error: Not enough memory for dynamic array allocation
-----------------------------------
Probably for CCC2013, question 5. Needs to be able to take in a lot of numbers.

-----------------------------------
Insectoid
Wed Mar 06, 2013 8:04 pm

RE:error: Not enough memory for dynamic array allocation
-----------------------------------
Even so, you shouldn't need all of those numbers at once.
