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

Автор pratikmoona, 15 лет назад, По-английски
could anyone please tell me the error with my code? It is giving wrong answer.

QUESTION: http://livearchive.onlinejudge.org/index.php?option=com_onlinejudge&page=show_problem&problem=3109

CODE: http://paste.bradleygill.com/index.php?paste_id=290688

The question is from an ACM-ICPC regional.
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

15 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится
Recommendations to solution – Playing Field

- Type: Precomputation, coordinate geometry
- Cannot find the area on the fly for all Q
- Precompute the area of all polygons with a segment joining 0 and x as end points.
- We can do this by using area of [0,x-1] and area of triangle [0,x-1,x]
- To find area of given polygon we need to add/ subtract the precomputed areas and 1 triangle (how?)