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??
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
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??
Название |
---|
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