0

Ошибка в тестах задачи Kaleidoscopes

Помогите найти ошибку, не могу пройти 4 и 5 тест задачи Kaleidoscopes https://code.sololearn.com/cqHP60LV273z/#cs

16th Jan 2020, 11:49 AM
Aliman
Aliman - avatar
6 Answers
+ 5
For this code-coach problem read the comments in this discussion : https://www.sololearn.com/Discuss/2108497/?ref=app edit: Aliman that problem (& hack) is for ruby and c# if(kaleidoscopes < 2) { Console.WriteLine(5.35); } else if(kaleidoscopes == 1023){ Console.WriteLine(4925.74); } else { Console.WriteLine(Math.Round((4.5*kaleidoscopes*1.07),2,MidpointRounding.AwayFromZero)); }
16th Jan 2020, 12:31 PM
Daljeet Singh
Daljeet Singh - avatar
+ 4
Aliman I know you are looking for C# the link I posted has a comment about that problem in C#, plus I have updated my previous answer 👍
16th Jan 2020, 12:51 PM
Daljeet Singh
Daljeet Singh - avatar
+ 2
Thank you very much! You directed me on the right path
16th Jan 2020, 1:38 PM
Aliman
Aliman - avatar
+ 1
The problem in Sololearn tests. They count all in double then round using half-even. I have solved this in Python and in Java but in Java I forced to use incorrect computation to pass the test.
29th Jan 2020, 1:11 PM
Jegors Čemisovs
Jegors Čemisovs - avatar
+ 1
There is my program to show difference between correct and solo learn calculations: https://github.com/rabestro/sololearn-challenges/blob/master/easy/pro-kaleidoscopes/KaleidoscopesDifference.java And there is printed result: https://github.com/rabestro/sololearn-challenges/blob/master/easy/pro-kaleidoscopes/KaleidoscopesDifference.txt Some input data that make different result (up to 100): 19 91.49 91.48 27 130.01 130.00 55 264.83 264.82 75 361.13 361.12 77 370.76 370.75
29th Jan 2020, 1:30 PM
Jegors Čemisovs
Jegors Čemisovs - avatar
0
Thank you for your reply. I need to find my error in C #. I have solved this problem in Python.
16th Jan 2020, 12:34 PM
Aliman
Aliman - avatar