Hi everyone

I got WA on test 5 for problem #151.

This is my code.

Can anyone help me?

**UPD**: after month I tried to code this problem again, but again WA on test 5 ! :( This is my new code. Can you help me? Thx in advance :).

# | User | Rating |
---|---|---|

1 | Benq | 3650 |

2 | Radewoosh | 3648 |

3 | tourist | 3579 |

4 | ecnerwala | 3551 |

5 | Um_nik | 3494 |

6 | Petr | 3452 |

7 | ksun48 | 3432 |

8 | jiangly | 3349 |

9 | maroonrk | 3338 |

10 | Miracle03 | 3314 |

# | User | Contrib. |
---|---|---|

1 | 1-gon | 211 |

2 | awoo | 188 |

3 | Errichto | 187 |

4 | rng_58 | 186 |

5 | SecondThread | 183 |

6 | Um_nik | 176 |

6 | Ashishgup | 176 |

8 | maroonrk | 174 |

9 | antontrygubO_o | 171 |

10 | -is-this-fft- | 169 |

Hi everyone

I got WA on test 5 for problem #151.

This is my code.

Can anyone help me?

**UPD**: after month I tried to code this problem again, but again WA on test 5 ! :( This is my new code. Can you help me? Thx in advance :).

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/12/2021 22:08:56 (j2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

when you find acos(angle), try to replace it finding just cosa, and sina = 1. — cos^2(a), may be it is because of the loss of precision... I don't know exactly

Thank you very much. But when i changed my code as you said, it got WA on test 1!!!!!! I am really confused. I can not find the mistake.

you make some unnecessary actions, firstly you found cos(alfa) then took alfa = acos(alfa), further again cos(alfa), it may be lose a precision; P.S you confused b and c, AB's length is c, AC's length is b

yes you are right, but i had changed it when i resubmitted (new code) and about the other thing: again you are right but i think i have done it rightly. i put point A on the origin and AB on the X axis.

of course) but the order must be A, B, C; here some fragments from statement: "**|AB|=c, |AC|=b**", "_Write coordinates of point A to first line, coordinates of B to second line and coordinates of C to third line_" That's why the point B will be on the distance c from A, C on the b distance from A;

No one helps? :(

After changing my solution output for the test

`1 3 2`

from`Mission impossible`

to 3 collinear points (degenerate triangle), I got AC instead of WA on test5.