idk321's blog

By idk321, history, 5 years ago, In English

Here is my whole program: https://pastebin.com/dqqGn0rn. Here is the part of the program where the overflow happens: https://pastebin.com/JCCj8knQ. I get this error on a test with a million nodes: https://pastebin.com/eCxBK4pf. Is perhaps the language is use (Java) the problem? Can I fix this without making it iteratively and without changing my language?

EDIT: also, for the test on which it failes it says: time: 763 ms., memory: 252648 KB EDIT2: link to the problem: https://codeforces.net/contest/1335/problem/F

EDIT3: I put all the parametres from the recursive methods that I could into the object variables instead, I was sure that would help but I still get the overflow...

EDIT4: idk why am I getting all those downvotes... Is it cause I use Java? lol

  • Vote: I like it
  • -7
  • Vote: I do not like it

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by idk321 (previous revision, new revision, compare).

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by idk321 (previous revision, new revision, compare).

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by idk321 (previous revision, new revision, compare).

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by idk321 (previous revision, new revision, compare).