1 / 9
May 2018

Hi,
I’m new to SPOJ and when I was trying the answer to Life, the universe in python 3(3.5). In my machine i kept the input once as a list and other time read it everytime. However, while making the submission, I am unable to figure out that how the code is receiving the input. is it line by line? or is it a list of input to code?
Please help me with this.

  • created

    Apr '18
  • last reply

    Aug '19
  • 8

    replies

  • 1.7k

    views

  • 7

    users

  • 1

    like

  • 3

    links

You’re given an input file (if my memory serves me right exactly one file.txt per test case) which content is redirected to your program. It is only your decision how to read it. You can read it line by line or character by character or even you have a possibility to ignore an input :wink:

Hi,

I am also new to SPOJ and m also facing problem with the input.As16 per the above comment m using a file.txt to take input but while uploading the code it is giving error though the code is working on my local.
Please help :slight_smile:

6 months later

I do not understand how to take the input either. I am writing in C#, and assumed my input was coming from Console.ReadLine() so that’s what I was writing in my code but that seems to be wrong.

using Console.ReadLine() is correct for c#. I thought there was an example solution, but I can’t find it now.

Can I use methods in my solution or can I only have a main?
Do I collect all the data using an infinite loop? While(true)?
Because when I submit my answer I am getting Time Limit exceeded but it’s actually very fast.

Didn’t there used to be one in the Other Languages forum?

9 months later

Hi, My code works on my mobile c ide but doesn’t work in this system.
I tried submit 20 times or more, Ineven copied the sample code from ideone, the result is always compilation error!!!
I don’t know what this shit is all about.