I was solving this problem on SPOJ
http://www.spoj.com/problems/STRSOCU/
I got a c++ code accepted but the same code written in java gives NZEC error
here is my java code
Why should this code give an NZEC error??
| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 143 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 136 |
| 8 | BledDest | 132 |
| 9 | maroonrk | 131 |
| 10 | qwexd | 129 |
I was solving this problem on SPOJ
http://www.spoj.com/problems/STRSOCU/
I got a c++ code accepted but the same code written in java gives NZEC error
here is my java code
Why should this code give an NZEC error??
| Name |
|---|



Don't close
out.Still NZEC
Can't
to[p].get(c)benullon Line 45?updated the code
refresh the link
But you are still closing
out. UPD: Oh, I think I'm mistaken, spoj wouldn't allow you to closebf,outis ok.http://ideone.com/Oac4hQ
The latest thing after removing the closing of
out.and putting the condition but still.but it still gives NZEC
I think I've got it. The default stack size is too small for Java on spoj. See this thread: http://codeforces.me/blog/entry/166.
I thought at the first glance that this might be the problem but I needed to make sure that there are no other problems.
I think I may spend sometime later to simulate the recursion with a stack or do the thread thingy if I am going to accept it with java.
Thank you so much :D .
LOOOOL.
I got it accepted by the help of that blog entry.
I set the size of the stack by myself for a thread.
Thank you so much :D .
I didn't ever imagined that I can control the memory's Stack size in java.
LOL