1 / 4
Oct 2018

No matter what kind of code I pass to the “Judge system” I get a runtime error (NZEC). For example this short piece of code(https://www.spoj.com/problems/CPTTRN4/30):

Here is a link to my code:

I was looking for some issues like mine in forum, but I didn’t find the answer. Thanks for help in advance :slight_smile:

  • created

    Oct '18
  • last reply

    Feb '19
  • 3

    replies

  • 2.1k

    views

  • 3

    users

  • 2

    links

21 days later

The input() method reads and returns the entire line at once, so you need to split it into the individual items before using int on it.

3 months later

I am facing similar problem with input() function.
Even though the code works in ideone with custom input, but i cant get it to work here in spoj.

Then perhaps the input in Spoj doesn’t look like you expect? Either it’s malformed (not as uncommon as you’d expect) or you’ve misread the input spec.