Canadian Computing Competition: 2024 Stage 1, Senior #1
At a recent social gathering, people sit around a circular table, where is even. The seats are numbered clockwise from to . Each person is wearing a hat with a number on it. Specifically, the person at seat is wearing a hat with the number on it.
Each person looks at the person who is directly across (diametrically opposite) them in the circle.
Determine the number of people who see someone with a hat with the same number as their own.
The first line of input will consist of one even positive integer , representing the number of people at the social gathering.
The next lines each contain a single non-negative integer , representing the hat number of person .
The following table shows how the available 15 marks are distributed:
| Marks | Bounds on | Bounds on | Description |
|---|---|---|---|
| 2 | Very small number of people; only two hat numbers | ||
| 1 | Only one hat number | ||
| 2 | People in even numbered seats have hat number ; people in odd numbered seats have hat number | ||
| 5 | Medium number of people | ||
| 5 | Large number of people and hat numbers |
Output a single integer representing the number of people who see their hat number on the person directly across from them.
Notice that every person sees their hat number. The people in seats and both see hat number , and the people in seats and both see hat number .
Notice that no person sees their hat number. The people in seats and both see hat number , and the people in seats and both see hat number .
No comments yet. Be the first to comment!