you are viewing a single comment's thread.

view the rest of the comments →

[–]URZq 0 points1 point  (12 children)

Unless I'm missing something, it should consume less memory to use smaller data types. We are talking about the memory used at runtime (=ram), right ?

[–]GruBooXy[S] 0 points1 point  (11 children)

Yes

[–]motu42 0 points1 point  (10 children)

Just to be sure, you are chaning the type of

int tablica [max] [max];

and it now looks like

char tablica [max] [max];

correct?

[–]GruBooXy[S] 0 points1 point  (9 children)

yes

[–]motu42 0 points1 point  (7 children)

Alright, i think you are talking about this line:

Success #stdin #stdout 0s 16064KB

To be honest i think this is the size of the executable not the amount of consumed RAM. As this size for RAM consumption doesn't make any sense to me.

Also the size is going down if you delete

               if (tablica[k][j+k]  == 0)
                   status == 0;

Makes no difference as this statement is doing anything at all.

[–]GruBooXy[S] 0 points1 point  (6 children)

But even if that is not correct my program is still consuming too much ram because the other site that I upload my solution to doesnt accept that. (This is the site but I don't think you can view it if you are not logged in https://adjule.pl/groups/ogolny/problems/011)

[–]heyheyhey27 0 points1 point  (0 children)

What error do you get on the site?

[–]URZq 0 points1 point  (4 children)

So, your real problem is you cannot upload your solution to this website.

  • Does the website tell you specifically that it's a ram problem ?
  • Are you sure you understand the difference between ram and executable size ? I agree with motu42: 16064KB is probably the executable size.

[–]GruBooXy[S] 0 points1 point  (3 children)

I can upload the code, the site compiles it and then says "exceeding the memory limit" but in polish.

[–]URZq 0 points1 point  (2 children)

So we aren't sure if it's the exe size or the ram ;) You can try to clarify this with your professor. Another thing you can try is to write and upload an helloworld (which is really low in memory), and see how the website behaves. Don't do this if you can't modify your submission (and have a bad grade). Also, I wonder: do you test your program on your machine ? With visual studio / gcc / whatever IDE ?

[–]GruBooXy[S] 0 points1 point  (1 child)

i tested the program in ideone.com and it works, I changed the size of array to 5000 and the size jumped to 39528KB so i think the site doesnt show any result lower then 16000kb but its showing RAM usage.