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 1249. Ancient Necropolis

to Admins
Posted by Ibragim Atadjanov 23 Sep 2009 10:27
My prog uses only
        private static byte[] mat;// max 3000 * 1 byte
    private static boolean ok;// 1 byte
    private static byte x, y; // 2 byte
    private static int n, m, i, j; // 4*4 byte=16 byte
field variables its memory cant be 5 510 KB.
total memory is 3019 B.
I cant understand why i'm getting memory limit on test6
If you have MLE in Java...
Posted by Forgotten (Samara STU) 23 Sep 2009 17:08
Try to read input strings this way:

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
.........
char[] input_str = new char[2 * m + 2];
.........
in.read(input_str, 0, 2 * m + 1);


It help me to get AC with 0.296 sec. and 1662КБ.

Good Luck!

Edited by author 23.09.2009 17:08

Edited by author 23.09.2009 17:08
Re: If you have MLE in Java...
Posted by Ibragim Atadjanov 23 Sep 2009 22:45
Thanks a lot. I got AC by your help