M
M
Masteron2015-10-07 20:17:35
Programming
Masteron, 2015-10-07 20:17:35

Olympiad programming in python obscure runtime error?

Here is a link to the task I'm trying to solve
Link to the task
And here is the code that the NOC finds for me, but when checking, the system issues a runtime error, what could be the problem?

import math
r = open("input.txt")
w = open("output.txt","w")
A,B = map(int,r.readline().split())
w.write(str((A*B / math.gcd(A,B))))
r.close()
w.close()

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Martyanov, 2015-10-07
@vilgeforce

The problem is something, since you do not realize that the full error output is needed.

A
Alexander, 2015-10-07
@NeiroNx

the problem is that there is no gcd function in the math module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question