QOJ.ac

QOJ

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

#21223. קרב הברידג׳ של הפרות

Statistics

כל $N$ הפרות של Farmer John ($4 \le N \le 1,000$) מחכות בסבלנות במרעה הראשי. פרה $i$ בנקודה השלמה ($X_{i}$, $Y_{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$.

הן רוצות קבוצות של ארבע לשחק ברידג׳, משחק הקלפים החדש האהוב עליהן. תנאי חשוב: הקבוצה מותרת אם ורק אם קיימת נקודה $X$ במישור, שונה מכל ארבעת המיקומים, כך שסיבוב כל פרה ב־$180$ מעלות סביב $X$ מביא אותה למיקום של פרה אחרת בקבוצה.

מצאו את מספר קבוצות ארבע הפרות שיוצרות קבוצת ברידג׳ חוקית.

למשל, נניח שמונה פרות בשמונה הנקודות הבאות:

                  |
                 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
---------*--*-----+-----*--*---------
                  |

שלוש הקבוצות החוקיות הן $\{a,b,e,d\}$ (סיבוב סביב $(-2,1)$), $\{b,c,e,f\}$ (סביב $(-1.5,1.5)$), ו־$\{c,d,g,h\}$ (סביב $(0,0)$).

כל המיקומים שונים ונתונים ללא סדר מסוים. התשובה מתאימה למספר שלם בעל סימן בן 32 סיביות.

קלט

  • שורה 1: שלם אחד $N$.
  • שורות $2 \ldots N+1$: השורה $i+1$ מכילה שני שלמים $X_{i}$, $Y_{i}$ מופרדים ברווח.

פלט

  • שורה 1: שלם אחד המונה קבוצות של ארבע פרות שיוצרות קבוצה חוקית לברידג׳.

דוגמאות

קלט 1

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

פלט 1

3

מחבר הבעיה: 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.