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

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

3287618-AC
3287689-WA
Both of them give correct answer on my computer. Could you please tell me why they have different verdicts?

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

»
11 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

input:

7 6 3

3289012
output:

*
1/1

3289015
output:

4/3

Can anyone explain it please ?

»
11 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Try using long double. I used it and got AC.

»
11 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

If both answers are the nearest, you should output the one with a smaller denominator. So if 9/6 and 3/2 are both ok, you shoud output 3/2. Reducing the fraction will ensure this.