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 | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | atcoder_official | 160 |
5 | Um_nik | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 151 |
9 | awoo | 149 |
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.net/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