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 1200. Horns and Hoofs

Mathematical solution with O(1) efficiency - why WA#2?Tests and help seriously needed...
Posted by Intelligent_Design 24 Sep 2006 23:39
Hi.
I've found a formulae to solve this problem as the fastest variant,but still experiencing some minor problems with this task,cause I've got WA on the 2nd test...
I've also tried all the tests I found in this thread,the programme did the well...however,my problem doesn't disappear...
Could you please help me,give some more tests or so?
Re: Mathematical solution with O(1) efficiency - why WA#2?Tests and help seriously needed...
Posted by IYI_Blade 27 Sep 2006 23:04
Do you handle the case where Horns + Hoofs can be < K

For example
2 2
10
The solution is
2.00
1 1
Re: Mathematical solution with O(1) efficiency - why WA#2?Tests and help seriously needed...
Posted by Bobur 28 Jan 2009 00:11
i think you did this like this::
x := TRUNC((a+1)/2);
y := TRUNC((b+1)/2);
you must write like this:
x := TRUNC((a+1)/2);
y := TRUNC(b/2);
i don't know why, but it help me!!!
good luck!