ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1119. Metro

Memory
Posted by Arsenal911 (Samara) 22 Aug 2011 02:08
My solution for a table size of 1000 to 1000 is 4.07 MB of memory. What should I do?
Re: Memory
Posted by Anatoly 5 Feb 2012 15:21
You shouldn't use table 1000*1000. It could be solved using table 1000*2
Re: Memory
Posted by Sunnat 25 Oct 2012 14:29
int x[100],y[100],max[100];
Re: Memory
Posted by Plamen_N 3 Nov 2012 03:01
I used: bool table[1000][1000];  which is 0,95367431640625 MB.
table[i][j] = 1, if the respective quarter can be crossed diagonally, and '0' otherwise.
I also used an array a[1001], in which to store the distance, and several auxiliary variables.
The total memory used is 1128 KB.