0
Ошибка в тестах задачи Kaleidoscopes
Помогите найти ошибку, не могу пройти 4 и 5 тест задачи Kaleidoscopes https://code.sololearn.com/cqHP60LV273z/#cs
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));
}
+ 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 👍
+ 2
Thank you very much! You directed me on the right path
+ 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.
+ 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
0
Thank you for your reply. I need to find my error in C #. I have solved this problem in Python.