2 / 2
Aug 2017

SPOJ has limitation of 48Mb for running sbcl.

How to check: Go to SPOJ custom test: http://www.spoj.com/problems/BACTERIA/8
and try this one:

(defun test()
  (let ((arr (make-array (expt 10 7) :initial-element 0)))
    (setf (aref arr (1- (length arr))) 42)
    ;; crash
    ))
  
(print (sb-ext:dynamic-space-size))

;; (test)

When running with ;; (test) commented it print dynamic-space-size which is 48 Mb. If you uncomment (test) it will NZEC.

You should be able to allocate 10^7 of long long, bool for solving, for ex,
http://www.spoj.com/problems/APS1, for sieve table, this problem can not be solved otherwise with this timelimit.

I would understand the limitation for compilation phase, if one wants to limit the power of CL during compile, but for runtime phase it's just ridiculous. You don't artificially limit memory allocation for C++, right?

  • created

    Jul '17
  • last reply

    Aug '17
  • 1

    reply

  • 1.0k

    views

  • 1

    user

  • 1

    like

  • 2

    links

24 days later

It's been a while since I wrote that. Is there a better way to talk to people who are in charge here? :slight_smile:

So, how to fix that :

If you insist on limiting mem allocation during compile time (48Mb) do this:
Instead of running sbcl --dynamic-space-size 48 [rest-of-cmd-line]
in BOTH compile and run scripts, just do it in compile script and NOT in runtime script.