ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

Python solution failing on test 1
Posted by hackerman420 30 Sep 2019 06:56
Hi, I'm not sure why I'm failing on test 1. Any ideas?

import sys

def main():
    ans = []
    for line in sys.stdin:
        nums = line.split()
        ans.extend([int(num) ** 0.5 for num in nums if num])
    for root in ans[::-1]:
        print("%.4f" % root)
Re: Python solution failing on test 1
Posted by ClayMix 17 Nov 2020 00:03
Hey, you wrote your code in function. Just paste your code out of function