+ 1

Limits of SoloLearn Code Playground

Hi, everybody! What does it mean: "Time limit exceeded", and "Memory limit exceeded" in SoloLearn Code Playground?

22nd Sep 2018, 6:44 PM
vvv
vvv - avatar
5 Antworten
+ 2
i just tested the memory limit. For me it seems to be 679 mb https://code.sololearn.com/cYWCnhFK7ScQ/?ref=app
22nd Sep 2018, 7:06 PM
Data
Data - avatar
+ 2
sololearn executes your code on their own servers. Time and mem limits are introduced to prevent some programs from running too long or take up too much memory From what i know, time limit is 5 seconds. Have to test what memory limit is
22nd Sep 2018, 6:49 PM
Data
Data - avatar
+ 2
Data While trying to understand how new[] is working--just to understand allocator differences--I noticed that malloc() works into the several gigabytes range. I also noticed, if you add a 1-second sleep right after your array allocation: std::this_thread::sleep_for(std::chrono::seconds(1)); The highest number you can use is fixed. Similarly, if your class allocator allocates just 1 byte (vs 1024^2), there's another limit but it's not clearly proportional. Knowing that new's supposed to allocate on the heap, I was still looking for some kind of stack exhaustion--I read somewhere that new with dynamic arrays was not preferred, but I haven't been able to determine why.
23rd Sep 2018, 12:43 AM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Beside Data said, this can happen randomatically (maybe for server problem)
22nd Sep 2018, 7:06 PM
KrOW
KrOW - avatar
+ 1
it seems that memory limit differs from time to time. My code i posted earlier doesent run sometimes
22nd Sep 2018, 7:08 PM
Data
Data - avatar