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 1392. Dreaming of Stars

memory limit
Posted by Vlad Precup 18 Mar 2006 14:42
why do I get mem. limit exceeded at test #2? (3 626 KB) is there a way I could optimize this program? I declared 7 arrays x 1000 each, and a 1000x1000 matrix... :|
Post the part of code where you declare your arrays (-)
Posted by Michael Rybak (accepted@ukr.net) 18 Mar 2006 16:45
-
Re: memory limit
Posted by ilucian1 25 Mar 2006 13:24
Hello, Vlad
This problem is quite easy. You don't have to use the adjacency matrix. Just think at disjoint sets and path compression. Declare a "sphere" type and write a function to test the intersection between two spheres.

Edited by author 25.03.2006 13:34