My code runs fine on my machine and on ideone. However, on spoj, i get runtime error (NZEC). Can someone please take a look and let me know what the issue is?
code at:
ideone.com/OGyCa
Thanks
created
last reply
- 5
replies
- 242
views
- 3
users
- 4
links
My code runs fine on my machine and on ideone. However, on spoj, i get runtime error (NZEC). Can someone please take a look and let me know what the issue is?
code at:
ideone.com/OGyCa
Thanks
Fiddling around with your code, I ran into NZEC with this input. Are you sure to process input correctly?
@daft_wullie Thanks.. Corrected that issue but i still get NZEC. ideone.com/rxcfp
Hi,
still I did not not understand your code nor your algo. I recognized that you use some recursion in your checkSequence function - and this can always result in an issue if exposed to real large test cases (e.g. runtime, recursion level, memory). Remember, there are up to 100 000 words allowed per test case.
So I only did some checks with your code, and I generated some larger input with 1200 words. And even on IDEone your code does not finish within 15 secs for this input. It is able to process approx. 675 words, but the runtime increases dramatically for lorger input.
Perhaps this helps to identify the bottleneck...
Regards
Daft
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
Akbar - TLE. Is it even possible to solve it in python? | Python | 5 | 127 | May '24 |