Content deleted Content added
Disambiguation link repair - You can help! |
Algorithm in Python |
||
Line 32:
map[$_+0,$_=<>],0..10
</pre>
==Python version==
The following Python version of the algorithm uses the common Python idiom of using a list instead of an array, (although their is an array module available):
from math import sqrt
def f(t):
return sqrt(abs(t))+5*t**3
a=list()
for i in range(11):
a.append(input())
for i in range(10,-1,-1):
y = f(a[i])
if y > 400:
print i, "TOO LARGE"
else:
print i,y
==References==
|