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

Why "wrong answer" (1001 - Ruby)
Posted by neverhood2015 30 May 2015 04:42
My code:
a = readlines
a = a.join
a = a.split(/\s+/)
a.reverse!
a.map!{|elem|elem.to_i}
a.map!{|elem|(elem**0.5).round(4)}
puts a

I've tried code from FAQ page:
tokens = []
while string = gets do
   string.split().each do |token|
      tokens << token
   end
end
tokens.reverse.each do |token|
   puts (token.to_i ** 0.5).round(4)
end

Both variants return right results in my terminal, but in both cases i've got "wrong answer" here.
Why?
Re: Why "wrong answer" (1001 - Ruby)
Posted by Vladimir Yakovlev (USU) 2 Jun 2015 10:30
There was a problem with Ruby solutions judging. The solution from FAQ gets AC now.