You are not logged in. Please login at www.codechef.com to post your questions!

×

NZEC error for FIRESC problem. Help needed!

This is the link to my code ==>> https://www.codechef.com/viewsolution/8869656

I have used vector array to make adjacency list and run DFS on it without Stack implementation, with the help of a parent array. Still I cant why is it throwing NZEC error. Out of Memory flow is not there because I have tested it on the boundary condition.

asked 05 Dec '15, 03:24

abhiroj786's gravatar image

2★abhiroj786
8111
accept rate: 22%

edited 05 Dec '15, 03:55


That recursion seems really deep. Are you sure DFS() won't overflow some java limit?

You should prefer iteration where possible anyway...

Try your own (very long and evil) input. If you get really desperate, you could try masking exceptions on parts of your program until the system gives WA instead of NZEC.

PS: 1340 MB used RAM sure looks alarming

link

answered 07 Dec '15, 02:53

kr0oze's gravatar image

0★kr0oze
1123
accept rate: 41%

edited 07 Dec '15, 03:04

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,314
×734
×73
×21

question asked: 05 Dec '15, 03:24

question was seen: 612 times

last updated: 07 Dec '15, 03:04