-1
I managed to run the program on my computer, however, when I submit to the online test cases it accuses 'Runtime error' and I am not able to circumvent the error.
The problem is (Sequence IJ 4), the link: https://www.urionlinejudge.com.br/judge/pt/problems/view/1098
My last submitted code is below
# Name of the problem: Sequencia IJ 4
# Link: https://www.urionlinejudge.com.br/judge/pt/problems/view/1098
import numpy
for i in numpy.arange(0.0, 2.2, 0.2):
for j in range(1, 4):
i_print = round(i,1)
i_print = str(i_print)
i_int, i_dec = i_print.split(".")
j_print = round(j+i,1)
j_print = str(j_print)
j_int, j_dec = j_print.split(".")
if(i_dec == '0'):
print('I='+i_int, end = " ")
else:
print('I='+i_int+'.'+i_dec, end = " ")
if(j_dec == '0'):
print('J='+j_int)
else:
print('J='+j_int+'.'+j_dec)
This is because during runtime some Exception is being lifted. Have you tried testing all of the uDebug cases? Moreover, your solution seems little performative, given the simplicity of the problem... Try to take a better look at the logic you should build! If you can raise Exception, update the post here.
– Enzo Ferrari
There are no test cases in this problem. Just print the logical sequence correctly at the time you put the code to run. A guy on facebook showed me the code he had done for the same problem (also gave Runtime Error here), I asked him to see if his code (https://bitbucket.org/galego/uri_online_judge_python/src/master/beginner/1098_sequencia_ij_4_solucao_2.py?fbclid=IwAR01PgUxH-OkoONlrikcEdURM_9aADnAnUFYmxvNqolfRaBqpXgzgSnceM) was accepted. The URI platform could be in some kind of trouble, I don’t know ... an assumption.
– dimitri.marinho
This question makes no sense and you literally need a crystal ball to add what exactly is the output he expects. Probably the error occurs because it is using the Numpy library and the platform does not have it available.
– Woss
I couldn’t understand the reason for Runtime Error, probably the use of the Numpy library itself. Regarding the problem, a guy on Facebook helped me to find a solution using the Decimal library (I didn’t know it, because I’m starting now in Python). I have solved the problem, I will answer my own question to add an answer here.
– dimitri.marinho