QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#21223. Trận bridge của bò

Statistics

Toàn bộ $N$ bò của Farmer John ($4 \le N \le 1,000$) kiên nhẫn chờ ở đồng cỏ chính. Bò $i$ tại điểm nguyên ($X_{i}$, $Y_{i}$), với $-1,000,000,000 \le X_{i} \le 1,000,000,000; -1,000,000,000 \le Y_{i} \le 1,000,000,000$.

Chúng muốn nhóm bốn để chơi bridge, trò bài mới yêu thích. Điều kiện quan trọng: nhóm hợp lệ khi và chỉ khi có điểm $X$ trên mặt phẳng, khác cả bốn vị trí, sao cho xoay bất kỳ bò nào $180$ độ quanh $X$ cho vị trí của bò khác trong nhóm.

Hãy tìm số tập hợp bốn bò có thể tạo nhóm bridge hợp lệ.

Ví dụ, giả sử tám bò đứng ở tám điểm sau:

                  |
                 f*
                  |             a = (-3, 1)    e = (-1, 1)
           b*     |             b = (-2, 2)    f = ( 0, 3)
        a      e  |             c = (-3, 0)    g = ( 2, 0)
         *     *  |             d = (-2, 0)    h = ( 3, 0)
         c  d     |     g  h
---------*--*-----+-----*--*---------
                  |

Ba tập hợp hợp lệ là $\{a,b,e,d\}$ (xoay quanh $(-2,1)$), $\{b,c,e,f\}$ (quanh $(-1.5,1.5)$), và $\{c,d,g,h\}$ (quanh $(0,0)$).

Các vị trí đều khác nhau và được cho không theo thứ tự cụ thể. Đáp án vừa trong số nguyên có dấu 32 bit.

Dữ liệu vào

  • Dòng 1: một số nguyên $N$.
  • Dòng $2 \ldots N+1$: dòng $i+1$ chứa hai số nguyên $X_{i}$, $Y_{i}$ cách nhau bởi dấu cách.

Dữ liệu ra

  • Dòng 1: một số nguyên đếm các tập hợp bốn bò tạo nhóm bridge hợp lệ.

Ví dụ

Dữ liệu vào 1

8
-3 0
-2 0
-1 1
0 3
2 0
-3 1
3 0
-2 2

Dữ liệu ra 1

3

Tác giả bài toán: Richard Ho, 2007

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.