Global declaration of array[1e5] doesn't take any memory.

I am using c++14 for coding. I declared 5 global arrays of size 10^5 each. But the submission is not taking any memory (and giving WA after 0.00s) as you can see here: https://www.codechef.com/JUNE17/status/SUMQ,patoliyam What can be possible reason? I have noticed that a lot of people facing same problem for this perticular question. Please help.
P.S. I am able to run program as per expectation on my PC.

1 Like

happened with me even

There is no problems with that problem. If you are getting WA, that means your approach is incorrect (or incomplete).

0.00s is usually when your program fails the initial input tests of the test file but that is not a gaurentee.

Some of test cases takes 0.56s time (and giving WA). But memory taken still remains 0M (as per submissions page) I tried to allocate memory dynamically. But problem persists.

same happening with me

time taken for some testcases is 0.56s and memory is 0M.

UPD:There is no problem with testcases . My code got accepted after struggling for hours.

Memory for your submission is 0M that might be a consequence of an early WA in a test file. There are two subtasks in the problem. Suppose there is one test file and for that file value of t is 10, if your code fails in the first test case, execution is immediately stopped and rest 9 test cases are not tested, (same for all tasks in all subtasks). Don’t stick to your current approach it’s not correct. June Challenge will last in 9 days. Try to solve it roughly, solve similar questions. There’s no problem in test cases or judge.

Its 48MB? Where is it written, cant find it :_( (Screenshot or quote text will be good!!)

@only4 That is not the memory limit. It is the maximum allowed size of the submitted file. Also, 50000 bytes is approximately 50 KB.

P.S.: Don’t have enough karma points to comment.

1 Like

I dont think thats memory limit, but not sure. You may be correct. Thanks for screenshot, will get back after confirming. Thanks again :slight_smile:

50000 Bytes = 50 KB approx. not 50 MB.

That is NOT the memory limit. It literally says “source limit”, and it is the size of the submitted file as @aneesh2312 says. Memory limit on Codechef is 1536 MB as stated here.

3 Likes

haha…if the memory limit would have been 50 KB then how will JAVA people will do CC.This is source code allowed size.

1 Like

Sorry about that, I think I was completely out of my mind. Thanks for correcting me @meooow, @aneesh2312. I Will try to avoid this kind of mistakes in future.

2 Likes

The logic is wrong bro , you are failing at the first test case, thereby there is no memory allocated. Try looking for a better algo to solve it, u got 9 days , keep thinking ! :slight_smile: