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 | tourist | 3856 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3462 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 160 |
4 | Um_nik | 158 |
5 | atcoder_official | 156 |
6 | djm03178 | 153 |
7 | adamant | 152 |
8 | luogu_official | 149 |
9 | awoo | 147 |
10 | TheScrasse | 146 |
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)
benull
on 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
,out
is 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