TEST - Life, the Universe, and Everything

Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits.





If you have some troubles with your code, you can take a look in the forum, you'll find the answer, only for this problem, in various languages.

Added by:Michał Małafiejski
Time limit:10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel Pentium G860 3GHz)
Languages:All except: SCM chicken
Resource:Douglas Adams, The Hitchhiker's Guide to the Galaxy

hide comments
vinayakbhat: 2015-05-28 11:34:39

easy one

Aman Dwivedi: 2015-05-25 12:12:17

runtime error: Non Zero Exit Code
What shall i do?

ethanhung: 2015-05-23 22:36:11

for java
I use the BufferedReader to read the input
also don`t add the "input:" and "output:" at the result
it will be a not correct answer

Last edit: 2015-05-23 22:37:40
durgesh11: 2015-05-21 21:36:53

wheather i can use an array of specified size or what .how i'll take the input

durgesh11: 2015-05-21 21:34:26

how will i take yhe input??
pls someone tell me

ajpennster: 2015-05-19 18:36:12

where is the input coming from if i want to use C?

pratyya10: 2015-05-13 05:56:43

Yes!!! Solved my first problem here. feeling too good. :-)

evil_g0d: 2015-05-12 22:47:45

I have completed but it took me 1 hour to code this problem
can anyone comment about my efficiency of code please

planaruk: 2015-05-09 14:18:57

i just started
if it wasn't because of the http://www.spoj.com/forum
i would not understand the question at all :0
i was like so is it pattern somehow
anyway i sloved it now

Anakar Parida: 2015-05-09 06:26:27

@a2aportal - I tried with JAVA and it was success. You might not have imported the jars. That is the reason you are receiving compilation problem.

Problem's scores 2 votes

Concept difficulty
Concept difficulty 3%
Implementation difficulty
Implementation difficulty 4%
53 11