Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Блог пользователя AT_80

Автор AT_80, история, 11 месяцев назад, По-английски

Recently, CSES updated the test cases of its problem Inversion Probability. This resulted in a large number of previously Accepted solutions getting a WA on one or more of the new cases.

My submission too was part of this. In particular, even after revision and rechecking from my side, it passes all but one of the 19 tests.
Here is the code:

Code

The test case on which it is giving a wrong answer is:

Input
Expected Output as per CSES
Output by my code

This, at least to me, seems like a scenario where my logic is certainly correct, but perhaps my implementation, or my understanding of how rounding of decimal point numbers in C++ works, is flawed.
And judging by the drop in the number of correct submissions after the addition of these new cases (was over 900 earlier, if I remember correctly, but is now at about 160), there definitely appears to be a catch in these new additions.

I tried the abovementined test case locally, and even at a 12 decimal point precision, the output was 53.418336500000
This only further perplxes me about where I am going wrong, as the question clearly mentions that half is to be rounded to even.
I would thus be really grateful if someone could explain what this is all about, and additionally, also advise me on how to correct my code.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +29
  • Проголосовать: не нравится