bayram's blog

By bayram, 12 years ago, In English

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

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
12 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

input:

7 6 3

3289012
output:

*
1/1

3289015
output:

4/3

Can anyone explain it please ?

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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.